tagged [ado.net]
Is There Any Difference Between SqlConnection.CreateCommand and new SqlCommand?
Is There Any Difference Between SqlConnection.CreateCommand and new SqlCommand? In .Net, is there any functional difference between creating a new `SqlCommand` object and attaching a `SqlConnection` t...
What is the use/advantage of using CommandBehavior.CloseConnection in ExecuteReader()
What is the use/advantage of using CommandBehavior.CloseConnection in ExecuteReader() Can anyone tell me what is the `CommandBehavior.CloseConnection` and what is the use/benefit of passing this as a ...
What is the difference between dataview and datatable?
What is the difference between dataview and datatable? What is the difference between DataView and DataTable in .NET? As far as I understand, DataView is just a false presentation of DataTable. When s...
ADO.NET: convert a DataTable to an array of DataRows
ADO.NET: convert a DataTable to an array of DataRows I'm using ADO.NET and C#, and I want to convert a DataTable object into an array of DataRows. What is an elegant way of doing this?
Check if SQL Connection is Open or Closed
Check if SQL Connection is Open or Closed How do you check if it is open or closed I was using however, even the State is 'Open' it fails on this check.
- Modified
- 27 Mar at 19:47
When using Trusted_Connection=true and SQL Server authentication, will this affect performance?
When using Trusted_Connection=true and SQL Server authentication, will this affect performance? If a connection string specifies `Trusted_Connection=true` with SQL Server authentication mode, will per...
- Modified
- 11 Apr at 23:0
How to resolve System.Type to System.Data.DbType?
How to resolve System.Type to System.Data.DbType? What is the best way to find [System.Data.DbType](http://msdn.microsoft.com/en-us/library/system.data.dbtype.aspx) enumeration value for Base Class Li...
Encrypt password in App.config
Encrypt password in App.config I want to encrypt the password in connection string. When I make a connection to DB the connection string is openly stored in App.config and I need to find a way to keep...
- Modified
- 2 Apr at 11:31
C# SQLConnection pooling
C# SQLConnection pooling Can anyone brief me how to do Connection Pooling in ADO.Net, I do need to connect to 3 separate databases. 2 of them are in same server and the other in a separate one. Better...
- Modified
- 28 Jul at 08:21
Get Columns of a Table by GetSchema() method
Get Columns of a Table by GetSchema() method I want to get list of columns of a table using `GetSchema` method in `ADO.Net`, my code is: And i get an empty `DataTable`, what is the problem?
What size do you use for varchar(MAX) in your parameter declaration?
What size do you use for varchar(MAX) in your parameter declaration? I normally set my column size when creating a parameter in ADO.NET. But what size do I use if the column is of type `VARCHAR(MAX)`?
- Modified
- 22 Jun at 09:33
.net connection pooling
.net connection pooling I don't get what is the syntax difference between regular connection and connection pool. When I'm using the `using` key such as: Is this the way to perform a connection pool?
- Modified
- 29 Jul at 21:47
Creating a SQL Server table from a C# datatable
Creating a SQL Server table from a C# datatable I have a DataTable that I manually created and loaded with data using C#. What would be the most efficient way to create a table in SQL Server 2005 that...
- Modified
- 28 Aug at 18:46
In-Out Parameter for SqlCommand
In-Out Parameter for SqlCommand I have the following parameter for SqlCommand. How do I make it to both in and out the paramter value for the Stored Procedure.
- Modified
- 16 Jul at 23:15
Rhino Mocks: How to mock ADO.NET's DataRow?
Rhino Mocks: How to mock ADO.NET's DataRow? ADO.NET has the notorious DataRow class which you cannot instantiate using new. This is a problem now that I find a need to mock it using Rhino Mocks. Does...
- Modified
- 1 Oct at 01:2
Get output parameter value in ADO.NET
Get output parameter value in ADO.NET My stored procedure has an output parameter: How can I retrieve this using ado.net? ``` using (SqlConnection conn = new SqlConnection(...)) { SqlCommand cmd = n...
How to test if a DataSet is empty?
How to test if a DataSet is empty? I'm modifying someone else's code where a query is performed using the following: How can I tell if the DataSet is empty (i.e. no results were returned)?
What does Trusted = yes/no mean in Sql connection string?
What does Trusted = yes/no mean in Sql connection string? What does Trusted = yes/no mean in Sql connection string? I am creating a connection string as below : Please Help
- Modified
- 7 Aug at 05:11
Insert 2 million rows into SQL Server quickly
Insert 2 million rows into SQL Server quickly I have to insert about 2 million rows from a text file. And with inserting I have to create some master tables. What is the best and fast way to insert su...
- Modified
- 6 Jan at 14:57
Specific cast is not valid, while retrieving scope_identity
Specific cast is not valid, while retrieving scope_identity I am getting exception: "Specific cast is not valid", here is the code
MultipleActiveResultSets=True or multiple connections?
MultipleActiveResultSets=True or multiple connections? I have some C# in which I create a reader on a connection (`ExecuteReader`), then for every row in that reader, perform another command (with `Ex...
- Modified
- 6 Jun at 07:16
How Do I Get the Selected DataRow in a DataGridView?
How Do I Get the Selected DataRow in a DataGridView? I have a DataTable bound to a DataGridView. I have FullRowSelect enabled in the DGV. Is there a way to get the selected row as a DataRow so that I ...
- Modified
- 21 May at 23:27
C# - What are Some High Performance Best Practices/Tips for ADO.NET
C# - What are Some High Performance Best Practices/Tips for ADO.NET I decided not to use an orm and going to use straight ADO.NET for my project. I know I know its gonna take longer to program but I j...
- Modified
- 9 Jun at 14:5
Are there any benefits of reading each field async from a SqlDataReader?
Are there any benefits of reading each field async from a SqlDataReader? Is there any gain in reading the fields asynchronously? Say if I have the following: ``` SqlDataReader reader = await cmd.Execu...
- Modified
- 10 Nov at 20:46