MySqlSharp.Provider
Class MySqlCommand

Represents a mySQL statement to execute against a SQL Server database.

Constructor Summary
MySqlCommand()
         Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class.
MySqlCommand(string cmdText)
         Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class with the text of the query.
MySqlCommand(string cmdText, MySqlSharp.Provider.MySqlConnection connection)
         Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class with the text of the query and a MySqlSharp.Provider.MySqlConnection.

Property Summary
string CommandText
         Gets or sets the SQL statement to execute at the data source.
int CommandTimeout
         Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
System.Data.CommandType CommandType
         Gets or sets a value indicating how the MySqlSharp.Provider.MySqlCommand.CommandText property is to be interpreted.
MySqlSharp.Provider.MySqlConnection Connection
         Gets or sets the MySqlSharp.Provider.MySqlConnection used by this instance of the MySqlSharp.Provider.MySqlCommand.
MySqlSharp.Provider.MySqlParameterCollection Parameters
         Gets the MySqlSharp.Provider.MySqlParameter.
System.Data.UpdateRowSource UpdatedRowSource
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Method Summary
void Cancel()
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
System.Data.IDbDataParameter CreateParameter()
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
void Dispose()
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
int ExecuteNonQuery()
         Executes a mySQL statement against the Connection and returns the number of rows affected.
System.Data.IDataReader ExecuteReader(System.Data.CommandBehavior cb)
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
System.Data.IDataReader ExecuteReader()
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
MySqlSharp.Provider.MySqlDataReader ExecuteReader()
         Sends the MySqlSharp.Provider.MySqlCommand.CommandText to the Connection and builds a MySqlSharp.Provider.MySqlDataReader.
MySqlSharp.Provider.MySqlDataReader ExecuteReader(System.Data.CommandBehavior cb)
         Sends the MySqlSharp.Provider.MySqlCommand.CommandText to the Connection, and builds a MySqlSharp.Provider.MySqlDataReader using one of the System.Data.CommandBehavior values.
object ExecuteScalar()
         Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored.
void Prepare()
         This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

MySqlCommand

public MySqlCommand()

Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class.


MySqlCommand

public MySqlCommand(string cmdText)

Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class with the text of the query.

Parameters:
cmdText - The text of the query.

MySqlCommand

public MySqlCommand(string cmdText,
                    MySqlSharp.Provider.MySqlConnection connection)

Initializes a new instance of the MySqlSharp.Provider.MySqlCommand class with the text of the query and a MySqlSharp.Provider.MySqlConnection.

Parameters:
cmdText - The text of the query.
connection - A MySqlSharp.Provider.MySqlConnection that represents the connection to a mySQL Server.
Property Detail

CommandText

public string CommandText

Gets or sets the SQL statement to execute at the data source.

Value:
The SQL statement to execute. The default is an empty string.

CommandTimeout

public int CommandTimeout

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

Value:
The time (in seconds) to wait for the command to execute. The default is 30 seconds.
Throws:
System.ArgumentException - The property value assigned is less than 0.

CommandType

public System.Data.CommandType CommandType

Gets or sets a value indicating how the MySqlSharp.Provider.MySqlCommand.CommandText property is to be interpreted.

Value:
One of the System.Data.CommandType values. The default is Text.
Throws:
System.NotSupportedException - Stored procedures are not supported in mySQL.

Connection

public MySqlSharp.Provider.MySqlConnection Connection

Gets or sets the MySqlSharp.Provider.MySqlConnection used by this instance of the MySqlSharp.Provider.MySqlCommand.

Value:
The connection to a data source. The default value is a null reference (Nothing in Visual Basic).

Parameters

public MySqlSharp.Provider.MySqlParameterCollection Parameters

Gets the MySqlSharp.Provider.MySqlParameter.

Value:
The parameters of the SQL statement. The default is an empty collection.

UpdatedRowSource

public System.Data.UpdateRowSource UpdatedRowSource

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Method Detail

Cancel

public void Cancel()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


CreateParameter

private System.Data.IDbDataParameter CreateParameter()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


Dispose

public void Dispose()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


ExecuteNonQuery

public int ExecuteNonQuery()

Executes a mySQL statement against the Connection and returns the number of rows affected.

You can't execute any command returning results here.

Returns:
The number of rows affected.

ExecuteReader

private System.Data.IDataReader ExecuteReader(System.Data.CommandBehavior cb)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


ExecuteReader

private System.Data.IDataReader ExecuteReader()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


ExecuteReader

public MySqlSharp.Provider.MySqlDataReader ExecuteReader()

Sends the MySqlSharp.Provider.MySqlCommand.CommandText to the Connection and builds a MySqlSharp.Provider.MySqlDataReader.

Returns:
A MySqlSharp.Provider.MySqlDataReader object.

ExecuteReader

public MySqlSharp.Provider.MySqlDataReader ExecuteReader(System.Data.CommandBehavior cb)

Sends the MySqlSharp.Provider.MySqlCommand.CommandText to the Connection, and builds a MySqlSharp.Provider.MySqlDataReader using one of the System.Data.CommandBehavior values.

If you use CommandBehavior.SingleResult, onlmy the first command can return values.

Parameters:
cb - One of the System.Data.CommandBehavior values.
Returns:
A MySqlSharp.Provider.MySqlDataReader object.

ExecuteScalar

public object ExecuteScalar()

Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored.

Returns:
The first column of the first row in the resultset.

Prepare

public void Prepare()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.