ADO.NET commands are important for stored procedures and running SQL Statements. Take a look at the commands' key properties and methods.
Ã‚Â· CommandText: (read/write) the T-SQL statement or stored procedure to execute at the data source.
Ã‚Â· CommandTimeout: (read/write) maximum time allowed for a command execution attempt.
Ã‚Â· CommandType: (read/write) a value indicating how the CommandText property is to be interpreted.
Ã‚Â· Connection: (read/write) the SqlConnection used by this instance of the SqlCommand.
Ã‚Â· Parameters: (read) the SqlParameterCollection.
Ã‚Â· Transaction: (read/write) the transaction in which the SqlCommand executes.
Ã‚Â· Cancel: cancels the execution of a SqlCommand.
Ã‚Â· CreateParameter: creates a new instance of a SqlParameter object.
Ã‚Â· ExecuteNonQuery: executes a T-SQL statement against the connection and returns the number of rows affected.
Ã‚Â· ExecuteReader: (overloaded) sends the CommandText to the connection and builds a SqlDataReader.
Ã‚Â· ExecuteScalar: executes the query, and returns the first column of the first row in the resultset returned by the query.
Ã‚Â· ExecuteXmlReader: sends the CommandText to the connection and builds an XmlReader object.
Ã‚Â· Prepare: creates a prepared version of the command on an instance of SQL Server.