C# Class MySql.Data.MySqlClient.MySqlCommand

Inheritance: ICloneable, IDisposable
ファイルを表示 Open project: elevate/mysqlconnector-.net Class Usage Examples

Private Properties

Property Type Description
AddToBatch void
AsyncExecuteWrapper object
CheckState void
ClearCommandTimer void
Close void
EstimatedSize long
GetCommandTextForBatching string
HandleCommandBehaviors void
ICloneable object
Prepare void
ResetReader void
ResetSqlSelectLimit void
TrimSemicolons string

Public Methods

Method Description
BeginExecuteNonQuery ( ) : IAsyncResult

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand.

BeginExecuteNonQuery ( AsyncCallback callback, object stateObject ) : IAsyncResult

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand.

BeginExecuteReader ( ) : IAsyncResult

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand, and retrieves one or more result sets from the server.

BeginExecuteReader ( CommandBehavior behavior ) : IAsyncResult

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand using one of the CommandBehavior values.

Cancel ( ) : void

Attempts to cancel the execution of a currently active command

Cancelling a currently active query only works with MySQL versions 5.0.0 and higher.

Clone ( ) : MySqlCommand

Creates a clone of this MySqlCommand object. CommandText, Connection, and Transaction properties are included as well as the entire parameter list.

CreateParameter ( ) : MySqlParameter

Creates a new instance of a MySqlParameter object.

This method is a strongly-typed version of IDbCommand.CreateParameter.

EndExecuteNonQuery ( IAsyncResult asyncResult ) : int

Finishes asynchronous execution of a SQL statement.

EndExecuteReader ( IAsyncResult result ) : MySqlDataReader

Finishes asynchronous execution of a SQL statement, returning the requested MySqlDataReader.

ExecuteNonQuery ( ) : int
ExecuteReader ( ) : MySqlDataReader
ExecuteReader ( CommandBehavior behavior ) : MySqlDataReader
ExecuteScalar ( ) : object
MySqlCommand ( ) : System
MySqlCommand ( string cmdText ) : System
MySqlCommand ( string cmdText, MySqlConnection connection ) : System
MySqlCommand ( string cmdText, MySqlConnection connection, MySqlTransaction transaction ) : System
Prepare ( ) : void

Protected Methods

Method Description
CreateDbParameter ( ) : DbParameter
Dispose ( bool disposing ) : void
ExecuteDbDataReader ( CommandBehavior behavior ) : DbDataReader

Private Methods

Method Description
AddToBatch ( MySqlCommand command ) : void
AsyncExecuteWrapper ( int type, CommandBehavior behavior ) : object
CheckState ( ) : void

Check the connection to make sure - it is open - it is not currently being used by a reader - and we have the right version of MySQL for the requested command type

ClearCommandTimer ( ) : void
Close ( MySqlDataReader reader ) : void
EstimatedSize ( ) : long
GetCommandTextForBatching ( ) : string
HandleCommandBehaviors ( CommandBehavior behavior ) : void
ICloneable ( ) : object
Prepare ( int cursorPageSize ) : void
ResetReader ( ) : void

Reset reader to null, to avoid "There is already an open data reader" on the next ExecuteReader(). Used in error handling scenarios.

ResetSqlSelectLimit ( ) : void

Reset SQL_SELECT_LIMIT that could have been modified by CommandBehavior.

TrimSemicolons ( string sql ) : string

Method Details

BeginExecuteNonQuery() public method

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand.
public BeginExecuteNonQuery ( ) : IAsyncResult
return IAsyncResult

BeginExecuteNonQuery() public method

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand.
public BeginExecuteNonQuery ( AsyncCallback callback, object stateObject ) : IAsyncResult
callback AsyncCallback /// An delegate that is invoked when the command's /// execution has completed. Pass a null reference (Nothing in Visual Basic) /// to indicate that no callback is required.
stateObject object A user-defined state object that is passed to the /// callback procedure. Retrieve this object from within the callback procedure /// using the property.
return IAsyncResult

BeginExecuteReader() public method

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand, and retrieves one or more result sets from the server.
public BeginExecuteReader ( ) : IAsyncResult
return IAsyncResult

BeginExecuteReader() public method

Initiates the asynchronous execution of the SQL statement or stored procedure that is described by this MySqlCommand using one of the CommandBehavior values.
public BeginExecuteReader ( CommandBehavior behavior ) : IAsyncResult
behavior CommandBehavior One of the values, indicating /// options for statement execution and data retrieval.
return IAsyncResult

Cancel() public method

Attempts to cancel the execution of a currently active command
Cancelling a currently active query only works with MySQL versions 5.0.0 and higher.
public Cancel ( ) : void
return void

Clone() public method

Creates a clone of this MySqlCommand object. CommandText, Connection, and Transaction properties are included as well as the entire parameter list.
public Clone ( ) : MySqlCommand
return MySqlCommand

CreateDbParameter() protected method

protected CreateDbParameter ( ) : DbParameter
return DbParameter

CreateParameter() public method

Creates a new instance of a MySqlParameter object.
This method is a strongly-typed version of IDbCommand.CreateParameter.
public CreateParameter ( ) : MySqlParameter
return MySqlParameter

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EndExecuteNonQuery() public method

Finishes asynchronous execution of a SQL statement.
public EndExecuteNonQuery ( IAsyncResult asyncResult ) : int
asyncResult IAsyncResult The returned by the call /// to .
return int

EndExecuteReader() public method

Finishes asynchronous execution of a SQL statement, returning the requested MySqlDataReader.
public EndExecuteReader ( IAsyncResult result ) : MySqlDataReader
result IAsyncResult The returned by the call to /// .
return MySqlDataReader

ExecuteDbDataReader() protected method

protected ExecuteDbDataReader ( CommandBehavior behavior ) : DbDataReader
behavior CommandBehavior
return DbDataReader

ExecuteNonQuery() public method

public ExecuteNonQuery ( ) : int
return int

ExecuteReader() public method

public ExecuteReader ( ) : MySqlDataReader
return MySqlDataReader

ExecuteReader() public method

public ExecuteReader ( CommandBehavior behavior ) : MySqlDataReader
behavior CommandBehavior
return MySqlDataReader

ExecuteScalar() public method

public ExecuteScalar ( ) : object
return object

MySqlCommand() public method

public MySqlCommand ( ) : System
return System

MySqlCommand() public method

public MySqlCommand ( string cmdText ) : System
cmdText string
return System

MySqlCommand() public method

public MySqlCommand ( string cmdText, MySqlConnection connection ) : System
cmdText string
connection MySqlConnection
return System

MySqlCommand() public method

public MySqlCommand ( string cmdText, MySqlConnection connection, MySqlTransaction transaction ) : System
cmdText string
connection MySqlConnection
transaction MySqlTransaction
return System

Prepare() public method

public Prepare ( ) : void
return void