Class BaseCommandInterceptor
BaseCommandInterceptor is the base class that should be used for all userland command interceptors
Inheritance
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public abstract class BaseCommandInterceptor
Properties
ActiveConnection
Gets the active connection.
Declaration
protected MySqlConnection ActiveConnection { get; }
Property Value
Type | Description |
---|---|
MySqlConnection |
Methods
ExecuteNonQuery(String, ref Int32)
Executes an SQL statement that returns the number of affected rows.
Declaration
public virtual bool ExecuteNonQuery(string sql, ref int returnValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | The SQL statement to execute. |
System.Int32 | returnValue | The number of affected rows. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
This method is intended to be overriden.
ExecuteReader(String, CommandBehavior, ref MySqlDataReader)
Executes an SQL statement that will return a resultset.
Declaration
public virtual bool ExecuteReader(string sql, CommandBehavior behavior, ref MySqlDataReader returnValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | The SQL statement to execute. |
System.Data.CommandBehavior | behavior | A value that describes the results of the query and its effect on the database. |
MySqlDataReader | returnValue | A MySqlDataReader object containing the result of the statement execution. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
This method is intended to be overriden.
ExecuteScalar(String, ref Object)
Executes an SQL statements that returns a scalar value such as a calculation.
Declaration
public virtual bool ExecuteScalar(string sql, ref object returnValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | The SQL statement to execute. |
System.Object | returnValue | A scalar value that represents the result returned by the execution of the SQL statement. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
This method is intended to be overriden.
Init(MySqlConnection)
Sets the active connection.
Declaration
public virtual void Init(MySqlConnection connection)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | The active connection. |