System.Data.SqlClient.SqlCommand Members

The members of System.Data.SqlClient.SqlCommand are listed below.

See Also: Inherited members from System.Data.Common.DbCommand

Public Constructors

Initializes a new instance of the System.Data.SqlClient.SqlCommand class.

Initializes a new instance of the System.Data.SqlClient.SqlCommand class with the text of the query.

Initializes a new instance of the System.Data.SqlClient.SqlCommand class with the text of the query and a System.Data.SqlClient.SqlConnection.

Initializes a new instance of the System.Data.SqlClient.SqlCommand class with the text of the query, a System.Data.SqlClient.SqlConnection, and the System.Data.SqlClient.SqlTransaction.

Public Properties

override
CommandTextstring.

Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.

override
CommandTimeoutint.

Gets or sets the wait time before terminating the attempt to execute a command and generating an error.

override
CommandTypeSystem.Data.CommandType.

Gets or sets a value indicating how the SqlCommand.CommandText property is to be interpreted.

ConnectionSqlConnection.

Gets or sets the System.Data.SqlClient.SqlConnection used by this instance of the System.Data.SqlClient.SqlCommand.

override
DesignTimeVisiblebool.

Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.

NotificationSystem.Data.Sql.SqlNotificationRequest.

Gets or sets a value that specifies the System.Data.Sql.SqlNotificationRequest object bound to this command.

NotificationAutoEnlistbool.

Gets or sets a value indicating whether the application should automatically receive query notifications from a common System.Data.SqlClient.SqlDependency object.

[read-only]
ParametersSqlParameterCollection.

Gets the System.Data.SqlClient.SqlParameterCollection.

TransactionSqlTransaction.

Gets or sets the System.Data.SqlClient.SqlTransaction within which the System.Data.SqlClient.SqlCommand executes.

override
UpdatedRowSourceSystem.Data.UpdateRowSource.

Gets or sets how command results are applied to the System.Data.DataRow when used by the Update method of the System.Data.Common.DbDataAdapter.

Protected Properties

override
DbConnectionSystem.Data.Common.DbConnection. Documentation for this section has not yet been entered.
[read-only]
override
DbParameterCollectionSystem.Data.Common.DbParameterCollection. Documentation for this section has not yet been entered.
override
DbTransactionSystem.Data.Common.DbTransaction. Documentation for this section has not yet been entered.

Public Methods

BeginExecuteNonQuery() : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand.

BeginExecuteNonQuery(AsyncCallback, object) : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand, given a callback procedure and state information.

BeginExecuteReader() : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand, and retrieves one or more result sets from the server.

BeginExecuteReader(System.Data.CommandBehavior) : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand using one of the System.Data.CommandBehavior values.

BeginExecuteReader(AsyncCallback, object) : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand and retrieves one or more result sets from the server, given a callback procedure and state information.

BeginExecuteReader(AsyncCallback, object, System.Data.CommandBehavior) : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand, using one of the CommandBehavior values, and retrieving one or more result sets from the server, given a callback procedure and state information.

BeginExecuteXmlReader() : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand and returns results as an System.Xml.XmlReader object.

BeginExecuteXmlReader(AsyncCallback, object) : IAsyncResult

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this System.Data.SqlClient.SqlCommand and returns results as an System.Xml.XmlReader object, using a callback procedure.

override
Cancel()

Tries to cancel the execution of a System.Data.SqlClient.SqlCommand.

Clone() : SqlCommand

Creates a new System.Data.SqlClient.SqlCommand object that is a copy of the current instance.

CreateParameter() : SqlParameter

Creates a new instance of a System.Data.SqlClient.SqlParameter object.

EndExecuteNonQuery(IAsyncResult) : int

Finishes asynchronous execution of a Transact-SQL statement.

EndExecuteReader(IAsyncResult) : SqlDataReader

Finishes asynchronous execution of a Transact-SQL statement, returning the requested System.Data.SqlClient.SqlDataReader.

EndExecuteXmlReader(IAsyncResult) : System.Xml.XmlReader

Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.

override
ExecuteNonQuery() : int

Executes a Transact-SQL statement against the connection and returns the number of rows affected.

ExecuteReader() : SqlDataReader

Sends the SqlCommand.CommandText to the SqlCommand.Connection and builds a System.Data.SqlClient.SqlDataReader.

ExecuteReader(System.Data.CommandBehavior) : SqlDataReader

Sends the SqlCommand.CommandText to the SqlCommand.Connection, and builds a System.Data.SqlClient.SqlDataReader using one of the System.Data.CommandBehavior values.

override
ExecuteScalar() : object

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

ExecuteXmlReader() : System.Xml.XmlReader

Sends the SqlCommand.CommandText to the SqlCommand.Connection and builds an System.Xml.XmlReader object.

override
Prepare()

Creates a prepared version of the command on an instance of SQL Server.

ResetCommandTimeout()

Resets the SqlCommand.CommandTimeout property to its default value.

Protected Methods

override
CreateDbParameter() : System.Data.Common.DbParameter
Documentation for this section has not yet been entered.
override
Dispose(bool)
Documentation for this section has not yet been entered.
override
ExecuteDbDataReader(System.Data.CommandBehavior) : System.Data.Common.DbDataReader
Documentation for this section has not yet been entered.

Public Events

StatementCompleted

Occurs when the execution of a Transact-SQL statement completes.

Explicitly Implemented Interface Members