ado.net

Insert data into SQL server with best performance

I have an application which intensively uses DB (SQL Server). As it must have high performance I would like to know the fastest way to insert record into DB.Fastest from the standpoint of execution time. What should I use ? As I know the fastest way is to create stored procedure and to call it from code (ADO.NET). Please let me know ...

sp_helptext output being dropped by ADO.NET ?

Hi all, I'm using the tool described here to clean up some cruft from our development DBs. I've encountered an odd issue with it and can't find the cause. For certain stored procedures, the GetProcedureText method (l:47, Validator.cs) fails to return the proc text, causing the program to behave unexpectedly. When debugging and stepping...

Catch/Raise event on table data update C#

Hi, I have 24/7 service which keeps setup (configuration data) for charging, routing and etc in the Sql Server. Once it is started it loads the data from table using Linq2SQL and use the data through all the application. And we need a solution to update the setup data in the table without restarting the application. So I am interested ...

Stored procedure call in method with OperationBehavior attribute: problems with transactions

I'm using ADO.Net's ExecuteNonQuery to call a stored procedure, works like a charm stand-alone but when implementing it where it should be called I'm running into problems concerning transactions. For example System.Data.SqlClient.SqlException: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statemen...

DataAdapter.Fill - Does it execute the stored procedure?

I need to capture how long it takes for my application to execute a stored procedure. The results of the procedure are being stored in a dataset by a DataAdapter. My question is does DataAdapter.Fill execute the stored procedure? If so I know I'm measuring the correct "start" point for the time interval I'm measuring. ...

Using SqlDependency in a Windows Application

Hi, I am trying to implement test application which will monitor all changes in table (MS SQL Server 2008). I have followed all steps described HERE, but strange thing is happening ... it goes for endless loop. When GetData calls adapter.Fill(dataToWatch, tableName); the dependency_OnChange event is raised which in its turn calls GetDat...

Update thousands of records in a DataSet to SQL Server

I have half a million records in a data set of which 50,000 are updated. Now I need to commit the updated records back to the SQL Server 2005 Database. What is the best and efficient way to do this considering the fact that such updates could be frequent (though concurrency is not an issue but performance is) ...

ADO Entity Framework 4 to WPF Datagrid. DatagridComboBox nightmare.

The WPF datagrid -seems- like it's going to work, but the combobox implementation does not work straight from the designer. So I'm left wandering around in the XAML randomly changing things trying to get it to work. The problems are numerous. I want to display a foreign key relationship (with drop down) instead of a bunch of numbers fo...

Entity Framework 4 - Code Only - How to set data type property as smalldatetime?

There's a way? var customer = constructor.Entity<Customer>(); customer.Property(c => c.Date).DataType("smalldatetime"); THANKS IN ADVANCE ...

Importing an Excel WorkSheet into a Datatable

I have been asked to create import functionality in my application. I am getting an excel worksheet as input. The worksheet has column headers followed by data. The users want to simply select an xls file from their system, click upload and the tool deletes the table in the database and adds this new data. I thought the best way would ...

Abstract class over Interfaces in ADO.Net Environment

I am developing a web app but is not satisfied with is architecture that I am following. The architecture is plain old conventional 3 tier architecture. What i want is follow some design pattern or architecture that will be help me in decoupling my code. I have idea about MVC and MVP architectures for Web App but i need different from ...

DataView.RowFilter Vs DataTable.Select() vs DataTable.Rows.Find()

Considering the code below: Dataview someView = new DataView(sometable) someView.RowFilter = someFilter; if(someView.count > 0) { …. } Quite a number of articles which say Datatable.Select() is better than using DataViews, but these are prior to VS2008. Solved: The Mystery of DataView's Poor Performance with Large Recordsets Array...

Is re-using a Command and Connection object in ado.net a legitimate way of reducing new object creation?

The current way our application is written, involves creating a new connection and command object in every method that access our sqlite db. Considering we need it to run on a WM5 device, that is leading to hideous performance. Our plan is to use just one connection object per-thread but it's also occurred to us to use one global comman...

how to backup database from sqlexpress

Hi all Please help me to backup my database from sqlexpress. ...

Can't update rows in my database using Entity Framework...?

Okay, this is really weird. I made a simple database with a single table, Customer, which has a single column, Name. From the database I auto-generated an ADO.NET Entity Data Model, and I'm trying to add a new Customer to it like so: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Test { ...

how to get rows created with DataTable.NewRow() in C# / ADO.NET 2.0?

Now I use Select and use a criteria which select only new rows. But is there any kind of GetInsertedRows-method. If I remember correctly there is status for each row so naturally one can loop through them all but that's not elegant. -Cheers -Matti ...

How to remove a certain row from DataTable ?

How do i achieve simple sql query like delete from Users where userCity='Munich' with DataTables ? p.s. without using Linq or something like that simply because i do not use it though project. ...

Entity Relationship Multiple 1:1's

I have an application where I have a generic object (table) called Hull. Each hull in the table is unique. I have another object that has three hulls, but they are specifically the Port_Hull, Center_Hull and Starboard_Hull. Rather than create a One to Many relationship, I was trying to create a one to one relationship for each one,...

Does Entity Framework use database connection pooling? and is it by default?

I have been searching for a while about how EF utilizes connections to SQL Server DB, and whether it is using Connection pools under the hood, but I couldn't find any details about that. ...

When using Oracle load balancing and ADO.NET, how do you know which host the command executed on?

It's possible to use Microsoft's OracleClient assembly to connect to an Oracle database, and using Oracle's connection string format, set it up to use load balancing, provided your Oracle environment supports it. The question I have is how do you know after the fact, which db host the command actually executed against? Is there a way to...