SqlCommand
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
Gets or sets the SqlConnection used by this instance of the SqlCommand.
Gets the SqlParameterCollection.
Gets or sets the SqlTransaction within which the SqlCommand executes.
Occurs when the execution of a Transact-SQL statement completes.
public SqlCommand()
Initializes a new instance of the SqlCommand class.
Initializes a new instance of the SqlCommand class with the text of the query.
Initializes a new instance of the SqlCommand class with the text of the query and a SqlConnection.
Initializes a new instance of the SqlCommand class with the text of the query, a SqlConnection, and the SqlTransaction.
public IAsyncResult BeginExecuteReader(AsyncCallback callback, object stateObject, CommandBehavior behavior)
Creates a new SqlCommand object that is a copy of the current instance.
Creates a new instance of a SqlParameter object.
Sends the CommandText to the Connection, and builds a SqlDataReader using one of the CommandBehavior values.
An asynchronous version of ExecuteReader, which sends the CommandText to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.
An asynchronous version of ExecuteReader, which sends the CommandText to the Connection, and builds a SqlDataReader. Exceptions will be reported via the returned Task object.
public Task<SqlDataReader> ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
An asynchronous version of ExecuteReader, which sends the CommandText to the Connection, and builds a SqlDataReader
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
An asynchronous version of ExecuteReader, which sends the CommandText to the Connection and builds a SqlDataReader.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
An asynchronous version of ExecuteXmlReader, which sends the CommandText to the Connection and builds an XmlReader object.
Exceptions will be reported via the returned Task object.
An asynchronous version of ExecuteXmlReader, which sends the CommandText to the Connection and builds an XmlReader object.
The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.