Top "Sqlcommand" questions

Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database which is used in Microsoft .NET.

What's the best method to pass parameters to SQLCommand?

What's the best method to pass parameters to SQLCommand? You can do: cmd.Parameters.Add("@Name", SqlDbType.VarChar, 20).Value = "Bob"; …

.net sql-server ado.net sqlcommand
What is the difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout?

Is there any difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout in .NET?

.net sqlconnection sqlcommand
Combining output of two or more select statement

How to combine output of two or more SELECT statements, I have multiple tables which are having some data that …

sql sql-server-2008 select sqlcommand
Save byte array in sql server

Am looking to use an approach in saving passwords that requires using byte array as in this post So which …

sql-server bytearray sqlcommand
When should "SqlDbType" and "size" be used when adding SqlCommand Parameters?

There is a related question to this: What's the best method to pass parameters to SQLCommand? But I am wanting …

c# .net ado.net sqlcommand
ReadOnlyException DataTable DataRow "Column X is read only."

I've got a short piece of code that originally created an SqlDataAdapter object over and over. Trying to streamline my …

c# datatable sqlcommand sqldataadapter
Turning a SqlCommand with parameters into a DataTable

I'm adapting some code that someone else wrote and need to return a DataTable for time's sake. I have code …

c# .net .net-3.5 datatable sqlcommand
MySqlCommand Command.Parameters.Add is obsolete

I'm making an C# windows Form Application in visual studio 2010. That application is connecting to an mysql database, and I …

c# mysql parameters deprecated sqlcommand
SqlCommand object, what length of time for CommandTimeout?

How do I decide what length of time to use as a timeout when using an SqlCommand object? On parts …

c# ado.net sqlcommand command-timeout
Does SqlCommand.Dispose close the connection?

Can I use this approach efficiently? using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString)) { cmd.Connection.Open(); // set …

.net garbage-collection dispose sqlconnection sqlcommand