What does it mean for an SqlConnection to be “enlisted” in a transaction? Does it simply mean that commands I execute on the connection will participate in the transaction?...
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)? cmd.Parameters.Add("@blah", SqlDbType.VarChar, ?????).Value =...
I have the following code: Using cmd As SqlCommand = Connection.CreateCommand cmd.CommandText = "UPDATE someTable SET Value = @Value" cmd.CommandText &= " WHERE Id = @Id" cmd.Parameters.AddWithValue("@Id", 1234) cmd.Parameters.AddWithValue("@Value",...
How do create a DataTable in C#? I did like this: DataTable dt = new DataTable(); dt.clear(); dt.Columns.Add("Name"); dt.Columns.Add("Marks"); How do I see the structure of DataTable? Now I...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow....
I have a stored procedure that has three parameters and I’ve been trying to use the following to return the results: context.Database.SqlQuery<myEntityType>("mySpName", param1, param2, param3); At first I tried...
I’ve recently started to use the Entity Framework 4.0 in my .NET 4.0 application and am curious about a few things relating to pooling. Connection pooling as I know...
After connecting to the database, can I get the name of all the columns that were returned in my SqlDataReader? 10 Answers 10
Inspired by this question where there are differing views on SET NOCOUNT… Should we use SET NOCOUNT ON for SQL Server? If not, why not? What it does Edit...
var connection = ConnectionFactory.GetConnection( ConfigurationManager.ConnectionStrings...