Chapter 10 Connector/Net API Reference

Table of Contents

10.1 MySql.Data.MySqlClient Namespace
10.1.1 MySql.Data.MySqlClientHierarchy
10.1.2 BaseCommandInterceptor Class
10.1.3 BaseExceptionInterceptor Class
10.1.4 MySqlCommand Class
10.1.5 MySqlCommandBuilder Class
10.1.6 MySqlConnection Class
10.1.7 MySqlDataAdapter Class
10.1.8 MySqlDataReader Class
10.1.9 MySqlDbType Enumeration
10.1.10 MySqlError Class
10.1.11 MySqlErrorCode Enumeration
10.1.12 MySqlException Class
10.1.13 MySqlHelper Class
10.1.14 MySqlInfoMessageEventArgs Class
10.1.15 MySqlInfoMessageEventHandler Delegate
10.1.16 MySqlParameter Class
10.1.17 MySqlParameterCollection Class
10.1.18 MySqlRowUpdatedEventArgs Class
10.1.19 MySqlRowUpdatedEventHandler Delegate
10.1.20 MySqlRowUpdatingEventArgs Class
10.1.21 MySqlRowUpdatingEventHandler Delegate
10.1.22 MySqlTransaction Class
10.2 MySql.Data.Types Namespace
10.2.1 MySql.Data.TypesHierarchy
10.2.2 MySqlConversionException Class
10.2.3 MySqlDateTime Structure
10.3 MySql.Data.MySqlClient.Memcached Namespace
10.3.1 BinaryClient Class
10.3.2 Client Class
10.3.3 TextClient Class
10.4 MySql.Data.MySqlClient.Replication Namespace
10.4.1 ReplicationManager Class
10.4.2 ReplicationRoundRobinServerGroup Class
10.4.3 ReplicationServer Class
10.4.4 ReplicationServerGroup Class

This section of the manual contains a complete reference to the Connector/Net ADO.NET component, automatically generated from the embedded documentation.

10.1 MySql.Data.MySqlClient Namespace

Namespace hierarchy

Classes

ClassDescription
BaseCommandInterceptorProvides a means of enhancing or replacing SQL commands through the connection string rather than recompiling.
BaseExceptionInterceptorProvides a means of enabling and disabling exception handling through the connection string rather than recompiling.
MySqlClientPermissionDerived from the .NET DBDataPermission class. For usage information, see Section 5.21, “Working with Partial Trust / Medium Trust”.
MySqlCommandRepresents a SQL statement to execute against a MySQL database. This class cannot be inherited.
MySqlCommandBuilderAutomatically generates single-table commands used to reconcile changes made to a DataSet with the associated MySQL database. This class cannot be inherited.
MySqlConnectionRepresents an open connection to a MySQL Server database. This class cannot be inherited.
MySqlDataAdapterRepresents a set of data commands and a database connection that are used to fill a dataset and update a MySQL database. This class cannot be inherited.
MySqlDataReaderProvides a means of reading a forward-only stream of rows from a MySQL database. This class cannot be inherited.
MySqlErrorCollection of error codes that can be returned by the server
MySqlExceptionThe exception that is thrown when MySQL returns an error. This class cannot be inherited.
MySqlHelperHelper class that makes it easier to work with the provider.
MySqlInfoMessageEventArgsProvides data for the InfoMessage event. This class cannot be inherited.
MySqlParameterRepresents a parameter to a MySqlCommand, and optionally, its mapping to DataSetcolumns. This class cannot be inherited.
MySqlParameterCollectionRepresents a collection of parameters relevant to a MySqlCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited.
MySqlRowUpdatedEventArgsProvides data for the RowUpdated event. This class cannot be inherited.
MySqlRowUpdatingEventArgsProvides data for the RowUpdating event. This class cannot be inherited.
MySqlTransactionRepresents a SQL transaction to be made in a MySQL database. This class cannot be inherited.

Delegates

DelegateDescription
MySqlInfoMessageEventHandlerRepresents the method that will handle the InfoMessage event of a MySqlConnection.
MySqlRowUpdatedEventHandlerRepresents the method that will handle the RowUpdatedevent of a MySqlDataAdapter.
MySqlRowUpdatingEventHandlerRepresents the method that will handle the RowUpdatingevent of a MySqlDataAdapter.

Enumerations

EnumerationDescription
MySqlDbTypeSpecifies MySQL-specific data type of a field, property, for use in a MySqlParameter.
MySqlErrorCode 

10.1.1 MySql.Data.MySqlClientHierarchy

See Also

MySql.Data.MySqlClient Namespace

10.1.2 BaseCommandInterceptor Class

The BaseCommandInterceptor class has these methods that you can override:

public virtual bool ExecuteScalar(string sql, ref object returnValue);
public virtual bool ExecuteNonQuery(string sql, ref int returnValue);
public virtual bool ExecuteReader(string sql, CommandBehavior behavior, ref MySqlDataReader returnValue);
public virtual void Init(MySqlConnection connection);

If your interceptor overrides one of the Execute... methods, set the returnValue output parameter and return true if you handled the event, or false if you did not handle the event. The SQL command is processed normally only when all command interceptors return false.

The connection passed to the Init method is the connection that is attached to this interceptor.

For full usage and examples, see Section 5.13, “Using the Connector/Net Interceptor Classes”.

10.1.3 BaseExceptionInterceptor Class

You develop an exception interceptor first by creating a subclass of the BaseExceptionInterceptor class. You must override the InterceptException() method. You can also override the Init() method to do some one-time initialization.

Each exception interceptor has 2 methods:

public abstract Exception InterceptException(Exception exception,
  MySqlConnection connection);
public virtual void Init(MySqlConnection connection);

The connection passed to Init() is the connection that is attached to this interceptor.

Each interceptor is required to override InterceptException and return an exception. It can return the exception it is given, or it can wrap it in a new exception. We currently do not offer the ability to suppress the exception.

For full usage and examples, see Section 5.13, “Using the Connector/Net Interceptor Classes”.

10.1.4 MySqlCommand Class

For a list of all members of this type, see MySqlCommand Members.

Syntax: Visual Basic

NotInheritable Public Class MySqlCommand_
  Inherits Component_
  Implements IDbCommand, ICloneable

Syntax: C#

public sealed class MySqlCommand : Component, IDbCommand, ICloneable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlCommand Members, MySql.Data.MySqlClient Namespace

10.1.4.1 MySqlCommand Members

MySqlCommand overview

Public Instance Constructors

MySqlCommandOverloaded. Initializes a new instance of the MySqlCommand class.

Public Instance Properties

CommandText 
CommandTimeout 
CommandType 
Connection 
Container (inherited from Component)Gets the IContainer that contains the Component.
IsPrepared 
Parameters 
Site (inherited from Component)Gets or sets the ISite of the Component.
Transaction 
UpdatedRowSource 

Public Instance Methods

CancelAttempts to cancel the execution of a MySqlCommand. This operation is not supported.
CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
CreateParameterCreates a new instance of a MySqlParameter object.
Dispose (inherited from Component)Releases all resources used by the Component.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
ExecuteNonQuery 
ExecuteReaderOverloaded.
ExecuteScalar 
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
Prepare 
ToString (inherited from Component)Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Disposed (inherited from Component)Adds an event handler to listen to the Disposed event on the component.

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.1 MySqlCommand Constructor

Initializes a new instance of the MySqlCommand class.

Overload List

Initializes a new instance of the MySqlCommand class.

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.1.1 MySqlCommand Constructor ()

Initializes a new instance of the MySqlCommand class.

Syntax: Visual Basic

Overloads Public Sub New()

Syntax: C#

public MySqlCommand();

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand Constructor Overload List

10.1.4.1.1.2 MySqlCommand Constructor (String)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal cmdText As String _
)

Syntax: C#

public MySqlCommand(
   string cmdText
);

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand Constructor Overload List

10.1.4.1.1.3 MySqlCommand Constructor (string, MySqlConnection)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal cmdText As String, _
   ByVal connection As MySqlConnection _
)

Syntax: C#

public MySqlCommand(
   string cmdText,
   MySqlConnection connection
);

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand Constructor Overload List

10.1.4.1.1.4 MySqlCommand Constructor (string, MySqlConnection, MySqlTransaction)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal cmdText As String, _
   ByVal connection As MySqlConnection, _
   ByVal transaction As MySqlTransaction _
)

Syntax: C#

public MySqlCommand(
   string cmdText,
   MySqlConnection connection,
   MySqlTransaction transaction
);

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand Constructor Overload List

10.1.4.1.2 CommandText Property

Syntax: Visual Basic

NotOverridable Public Property CommandText As String _
_
  Implements IDbCommand.CommandText

Syntax: C#

public string CommandText {get; set;}

Implements

IDbCommand.CommandText

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.3 CommandTimeout Property

Syntax: Visual Basic

NotOverridable Public Property CommandTimeout As Integer _
  Implements IDbCommand.CommandTimeout

Syntax: C#

public int CommandTimeout {get; set;}

Implements

IDbCommand.CommandTimeout

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.4 CommandType Property

Syntax: Visual Basic

NotOverridable Public Property CommandType As CommandType _
  Implements IDbCommand.CommandType

Syntax: C#

public System.Data.CommandType CommandType {get; set;}

Implements

IDbCommand.CommandType

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.5 Connection Property

Syntax: Visual Basic

Public Property Connection As MySqlConnection

Syntax: C#

public MySqlConnection Connection {get; set;}

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.6 IsPrepared Property

Syntax: Visual Basic

Public ReadOnly Property IsPrepared As Boolean

Syntax: C#

public bool IsPrepared {get;}

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.7 Parameters Property

Syntax: Visual Basic

Public ReadOnly Property Parameters As MySqlParameterCollection

Syntax: C#

public MySqlParameterCollection Parameters {get;}

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.8 Transaction Property

Syntax: Visual Basic

Public Property Transaction As MySqlTransaction

Syntax: C#

public MySqlTransaction Transaction {get; set;}

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.9 UpdatedRowSource Property

Syntax: Visual Basic

NotOverridable Public Property UpdatedRowSource As UpdateRowSource _
  Implements IDbCommand.UpdatedRowSource

Syntax: C#

public System.Data.UpdateRowSource UpdatedRowSource {get; set;}

Implements

IDbCommand.UpdatedRowSource

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.10 MySqlCommand.Cancel Method

Attempts to cancel the execution of a MySqlCommand. This operation is not supported.

Syntax: Visual Basic

NotOverridable Public Sub Cancel() _
  Implements IDbCommand.Cancel

Syntax: C#

public void Cancel();

Implements

IDbCommand.Cancel

Remarks

Cancelling an executing command is currently not supported on any version of MySQL.

Exceptions

Exception TypeCondition
NotSupportedExceptionThis operation is not supported.

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.11 MySqlCommand.CreateParameter Method

Creates a new instance of a MySqlParameter object.

Syntax: Visual Basic

Public Function CreateParameter() As MySqlParameter

Syntax: C#

public MySqlParameter CreateParameter();

Return Value

A MySqlParameter object.

Remarks

This method is a strongly-typed version of CreateParameter.

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.12 MySqlCommand.ExecuteNonQuery Method

Syntax: Visual Basic

NotOverridable Public Function ExecuteNonQuery() As Integer _
  Implements IDbCommand.ExecuteNonQuery

Syntax: C#

public int ExecuteNonQuery();

Implements

IDbCommand.ExecuteNonQuery

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.13 ExecuteReader Method

Overload List

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.13.1 MySqlCommand.ExecuteReader Method

Syntax: Visual Basic

Overloads Public Function ExecuteReader() As MySqlDataReader

Syntax: C#

public MySqlDataReader ExecuteReader();

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand.ExecuteReader Overload List

10.1.4.1.13.2 MySqlCommand.ExecuteReader Method

Syntax: Visual Basic

Overloads Public Function ExecuteReader( _
   ByVal behavior As CommandBehavior _
) As MySqlDataReader

Syntax: C#

public MySqlDataReader ExecuteReader(
   CommandBehavior behavior
);

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace, MySqlCommand.ExecuteReader Overload List

10.1.4.1.14 MySqlCommand.ExecuteScalar Method

Syntax: Visual Basic

NotOverridable Public Function ExecuteScalar() As Object _
  Implements IDbCommand.ExecuteScalar

Syntax: C#

public object ExecuteScalar();

Implements

IDbCommand.ExecuteScalar

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.4.1.15 MySqlCommand.Prepare Method

Syntax: Visual Basic

NotOverridable Public Sub Prepare() _
  Implements IDbCommand.Prepare

Syntax: C#

public void Prepare();

Implements

IDbCommand.Prepare

See Also

MySqlCommand Class, MySql.Data.MySqlClient Namespace

10.1.5 MySqlCommandBuilder Class

For a list of all members of this type, see MySqlCommandBuilder Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlCommandBuilder _
  Inherits Component

Syntax: C#

public sealed class MySqlCommandBuilder : Component

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlCommandBuilder Members, MySql.Data.MySqlClient Namespace

10.1.5.1 MySqlCommandBuilder Members

MySqlCommandBuilder overview

Public Static (Shared) Methods

DeriveParametersOverloaded. Retrieves parameter information from the stored procedure specified in the MySqlCommand and populates the Parameters collection of the specified MySqlCommand object. This method is not currently supported since stored procedures are not available in MySql.

Public Instance Constructors

MySqlCommandBuilderOverloaded. Initializes a new instance of the MySqlCommandBuilder class.

Public Instance Properties

Container (inherited from Component)Gets the IContainer that contains the Component.
DataAdapter 
QuotePrefix 
QuoteSuffix 
Site (inherited from Component)Gets or sets the ISite of the Component.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component)Releases all resources used by the Component.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetDeleteCommand 
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInsertCommand 
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
GetUpdateCommand 
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
RefreshSchema 
ToString (inherited from Component)Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Disposed (inherited from Component)Adds an event handler to listen to the Disposed event on the component.

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.1 DeriveParameters Method

Retrieves parameter information from the stored procedure specified in the MySqlCommand and populates the Parameters collection of the specified MySqlCommand object. This method is not currently supported since stored procedures are not available in MySql.

Overload List

Retrieves parameter information from the stored procedure specified in the MySqlCommand and populates the Parameters collection of the specified MySqlCommand object. This method is not currently supported since stored procedures are not available in MySql.

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.1.1 MySqlCommandBuilder.DeriveParameters Method

Retrieves parameter information from the stored procedure specified in the MySqlCommand and populates the Parameters collection of the specified MySqlCommand object. This method is not currently supported since stored procedures are not available in MySql.

Syntax: Visual Basic

Overloads Public Shared Sub DeriveParameters( _
   ByVal command As MySqlCommand _
)

Syntax: C#

public static void DeriveParameters(
   MySqlCommand command
);

Parameters

  • command: The MySqlCommand referencing the stored procedure from which the parameter information is to be derived. The derived parameters are added to the Parameters collection of the MySqlCommand.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThe command text is not a valid stored procedure name.

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder.DeriveParameters Overload List

10.1.5.1.1.2 MySqlCommandBuilder.DeriveParameters Method

Syntax: Visual Basic

Overloads Public Shared Sub DeriveParameters( _
   ByVal command As MySqlCommand, _
   ByVal useProc As Boolean _
)

Syntax: C#

public static void DeriveParameters(
   MySqlCommand command,
   bool useProc
);

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder.DeriveParameters Overload List

10.1.5.1.2 MySqlCommandBuilder Constructor

Initializes a new instance of the MySqlCommandBuilder class.

Overload List

Initializes a new instance of the MySqlCommandBuilder class.

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.2.1 MySqlCommandBuilder Constructor ()

Initializes a new instance of the MySqlCommandBuilder class.

Syntax: Visual Basic

Overloads Public Sub New()

Syntax: C#

public MySqlCommandBuilder();

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder Constructor Overload List

10.1.5.1.2.2 MySqlCommandBuilder Constructor (MySqlDataAdapter)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal adapter As MySqlDataAdapter _
)

Syntax: C#

public MySqlCommandBuilder(
   MySqlDataAdapter adapter
);

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder Constructor Overload List

10.1.5.1.2.3 MySqlCommandBuilder Constructor (MySqlDataAdapter, bool)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal adapter As MySqlDataAdapter, _
   ByVal lastOneWins As Boolean _
)

Syntax: C#

public MySqlCommandBuilder(
   MySqlDataAdapter adapter,
   bool lastOneWins
);

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder Constructor Overload List

10.1.5.1.2.4 MySqlCommandBuilder Constructor (bool)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal lastOneWins As Boolean _
)

Syntax: C#

public MySqlCommandBuilder(
   bool lastOneWins
);

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace, MySqlCommandBuilder Constructor Overload List

10.1.5.1.3 DataAdapter Property

Syntax: Visual Basic

Public Property DataAdapter As MySqlDataAdapter

Syntax: C#

public MySqlDataAdapter DataAdapter {get; set;}

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.4 QuotePrefix Property

Syntax: Visual Basic

Public Property QuotePrefix As String

Syntax: C#

public string QuotePrefix {get; set;}

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.5 QuoteSuffix Property

Syntax: Visual Basic

Public Property QuoteSuffix As String

Syntax: C#

public string QuoteSuffix {get; set;}

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.6 MySqlCommandBuilder.GetDeleteCommand Method

Syntax: Visual Basic

Public Function GetDeleteCommand() As MySqlCommand

Syntax: C#

public MySqlCommand GetDeleteCommand();

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.7 MySqlCommandBuilder.GetInsertCommand Method

Syntax: Visual Basic

Public Function GetInsertCommand() As MySqlCommand

Syntax: C#

public MySqlCommand GetInsertCommand();

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.8 MySqlCommandBuilder.GetUpdateCommand Method

Syntax: Visual Basic

Public Function GetUpdateCommand() As MySqlCommand

Syntax: C#

public MySqlCommand GetUpdateCommand();

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.5.1.9 MySqlCommandBuilder.RefreshSchema Method

Syntax: Visual Basic

Public Sub RefreshSchema()

Syntax: C#

public void RefreshSchema();

See Also

MySqlCommandBuilder Class, MySql.Data.MySqlClient Namespace

10.1.6 MySqlConnection Class

For a list of all members of this type, see MySqlConnection Members.

Syntax: Visual Basic

NotInheritable Public Class MySqlConnection_
  Inherits Component_
  Implements IDbConnection, ICloneable

Syntax: C#

public sealed class MySqlConnection : Component, IDbConnection, ICloneable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlConnection Members, MySql.Data.MySqlClient Namespace

10.1.6.1 MySqlConnection Members

MySqlConnection overview

Public Instance Constructors

MySqlConnectionOverloaded. Initializes a new instance of the MySqlConnection class.

Public Instance Properties

ConnectionString 
ConnectionTimeout 
Container (inherited from Component)Gets the IContainer that contains the Component.
Database 
DataSourceGets the name of the MySQL server to which to connect.
ServerThreadReturns the ID of the server thread this connection is executing on.
ServerVersion 
Site (inherited from Component)Gets or sets the ISite of the Component.
State 
UseCompressionIndicates if this connection should use compression when communicating with the server.

Public Instance Methods

BeginTransactionOverloaded.
ChangeDatabase 
Close 
CreateCommand 
CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component)Releases all resources used by the Component.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
Open 
PingPing
ToString (inherited from Component)Returns a String containing the name of the Component, if any. This method should not be overridden.

Public Instance Events

Disposed (inherited from Component)Adds an event handler to listen to the Disposed event on the component.
InfoMessage 
StateChange 

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.1 MySqlConnection Constructor

Initializes a new instance of the MySqlConnection class.

Overload List

Initializes a new instance of the MySqlConnection class.

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.1.1 MySqlConnection Constructor

Initializes a new instance of the MySqlConnection class.

Syntax: Visual Basic

Overloads Public Sub New()

Syntax: C#

public MySqlConnection();

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace, MySqlConnection Constructor Overload List

10.1.6.1.1.2 MySqlConnection Constructor (string)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal connectionString As String _
)

Syntax: C#

public MySqlConnection(
   string connectionString
);

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace, MySqlConnection Constructor Overload List

10.1.6.1.2 ConnectionString Property

Syntax: Visual Basic

NotOverridable Public Property ConnectionString As String _
  Implements IDbConnection.ConnectionString

Syntax: C#

public string ConnectionString {get; set;}

Implements

IDbConnection.ConnectionString

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.3 ConnectionTimeout Property

Syntax: Visual Basic

NotOverridable Public ReadOnly Property ConnectionTimeout As Integer _
  Implements IDbConnection.ConnectionTimeout

Syntax: C#

public int ConnectionTimeout {get;}

Implements

IDbConnection.ConnectionTimeout

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.4 Database Property

Syntax: Visual Basic

NotOverridable Public ReadOnly Property Database As String _
  Implements IDbConnection.Database

Syntax: C#

public string Database {get;}

Implements

IDbConnection.Database

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.5 DataSource Property

Gets the name of the MySQL server to which to connect.

Syntax: Visual Basic

Public ReadOnly Property DataSource As String

Syntax: C#

public string DataSource {get;}

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.6 ServerThread Property

Returns the ID of the server thread on which this connection is executing.

Syntax: Visual Basic

Public ReadOnly Property ServerThread As Integer

Syntax: C#

public int ServerThread {get;}

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.7 ServerVersion Property

Syntax: Visual Basic

Public ReadOnly Property ServerVersion As String

Syntax: C#

public string ServerVersion {get;}

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.8 State Property

Syntax: Visual Basic

NotOverridable Public ReadOnly Property State As ConnectionState _
  Implements IDbConnection.State

Syntax: C#

public System.Data.ConnectionState State {get;}

Implements

IDbConnection.State

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.9 UseCompression Property

Indicates if this connection should use compression when communicating with the server.

Syntax: Visual Basic

Public ReadOnly Property UseCompression As Boolean

Syntax: C#

public bool UseCompression {get;}

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.10 BeginTransaction Method

Overload List

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.10.1 MySqlConnection.BeginTransaction Method

Syntax: Visual Basic

Overloads Public Function BeginTransaction() As MySqlTransaction

Syntax: C#

public MySqlTransaction BeginTransaction();

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace, MySqlConnection.BeginTransaction Overload List

10.1.6.1.10.2 MySqlConnection.BeginTransaction Method (IsolationLevel)

Syntax: Visual Basic

Overloads Public Function BeginTransaction( _
   ByVal iso As IsolationLevel _
) As MySqlTransaction

Syntax: C#

public MySqlTransaction BeginTransaction(
   IsolationLevel iso
);

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace, MySqlConnection.BeginTransaction Overload List

10.1.6.1.11 MySqlConnection.ChangeDatabase Method

Syntax: Visual Basic

NotOverridable Public Sub ChangeDatabase( _
   ByVal databaseName As String _
) _
  Implements IDbConnection.ChangeDatabase

Syntax: C#

public void ChangeDatabase(
   string databaseName
);

Implements

IDbConnection.ChangeDatabase

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.12 MySqlConnection.Close Method

Syntax: Visual Basic

NotOverridable Public Sub Close() _
  Implements IDbConnection.Close

Syntax: C#

public void Close();

Implements

IDbConnection.Close

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.13 MySqlConnection.CreateCommand Method

Syntax: Visual Basic

Public Function CreateCommand() As MySqlCommand

Syntax: C#

public MySqlCommand CreateCommand();

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.14 MySqlConnection.Open Method

Syntax: Visual Basic

NotOverridable Public Sub Open() _
  Implements IDbConnection.Open

Syntax: C#

public void Open();

Implements

IDbConnection.Open

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.15 MySqlConnection.Ping Method

Ping

Syntax: Visual Basic

Public Function Ping() As Boolean

Syntax: C#

public bool Ping();

Return Value

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.16 MySqlConnection.InfoMessage Event

Syntax: Visual Basic

Public Event InfoMessage As MySqlInfoMessageEventHandler

Syntax: C#

public event MySqlInfoMessageEventHandler InfoMessage;

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.6.1.17 MySqlConnection.StateChange Event

Syntax: Visual Basic

Public Event StateChange As StateChangeEventHandler

Syntax: C#

public event StateChangeEventHandler StateChange;

See Also

MySqlConnection Class, MySql.Data.MySqlClient Namespace

10.1.7 MySqlDataAdapter Class

For a list of all members of this type, see MySqlDataAdapter Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlDataAdapter_
  Inherits DbDataAdapter

Syntax: C#

public sealed class MySqlDataAdapter : DbDataAdapter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlDataAdapter Members, MySql.Data.MySqlClient Namespace

10.1.7.1 MySqlDataAdapter Members

MySqlDataAdapter overview

Public Instance Constructors

MySqlDataAdapterOverloaded. Initializes a new instance of the MySqlDataAdapter class.

Public Instance Properties

AcceptChangesDuringFill (inherited from DataAdapter)Gets or sets a value indicating whether AcceptChangesis called on a DataRowafter it is added to the DataTableduring any of the Fill operations.
AcceptChangesDuringUpdate (inherited from DataAdapter)Gets or sets whether AcceptChangesis called during a Update.
Container (inherited from Component)Gets the IContainer that contains the Component.
ContinueUpdateOnError (inherited from DataAdapter)Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.
DeleteCommandOverloaded.
FillLoadOption (inherited from DataAdapter)Gets or sets the LoadOption that determines how the adapter fills the DataTablefrom the DbDataReader.
InsertCommandOverloaded.
MissingMappingAction (inherited from DataAdapter)Determines the action to take when incoming data does not have a matching table or column.
MissingSchemaAction (inherited from DataAdapter)Determines the action to take when existing DataSetschema does not match incoming data.
ReturnProviderSpecificTypes (inherited from DataAdapter)Gets or sets whether the Fillmethod should return provider-specific values or common CLS-compliant values.
SelectCommandOverloaded.
Site (inherited from Component)Gets or sets the ISite of the Component.
TableMappings (inherited from DataAdapter)Gets a collection that provides the master mapping between a source table and a DataTable.
UpdateBatchSize (inherited from DbDataAdapter)Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.
UpdateCommandOverloaded.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from Component)Releases all resources used by the Component.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
Fill (inherited from DbDataAdapter)Overloaded. Adds or refreshes rows in the DataSetto match those in the data source using the DataSetname, and creates a DataTablenamed "Table."
FillSchema (inherited from DbDataAdapter)Overloaded. Configures the schema of the specified DataTablebased on the specified SchemaType.
GetFillParameters (inherited from DbDataAdapter)Gets the parameters set by the user when executing an SQL SELECT statement.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
ResetFillLoadOption (inherited from DataAdapter)Resets FillLoadOptionto its default state and causes Fillto honor AcceptChangesDuringFill.
ShouldSerializeAcceptChangesDuringFill (inherited from DataAdapter)Determines whether the AcceptChangesDuringFillproperty should be persisted.
ShouldSerializeFillLoadOption (inherited from DataAdapter)Determines whether the FillLoadOptionproperty should be persisted.
ToString (inherited from Component)Returns a String containing the name of the Component, if any. This method should not be overridden.
Update (inherited from DbDataAdapter)Overloaded. Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet.

Public Instance Events

Disposed (inherited from Component)Adds an event handler to listen to the Disposed event on the component.
FillError (inherited from DataAdapter)Returned when an error occurs during a fill operation.
RowUpdatedOccurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires.
RowUpdatingOccurs during Update before a command is executed against the data source. The attempt to update is made, so the event fires.

Protected Internal Instance Properties

FillCommandBehavior (inherited from DbDataAdapter)Gets or sets the behavior of the command used to fill the data adapter.

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.1 MySqlDataAdapter Constructor

Initializes a new instance of the MySqlDataAdapter class.

Overload List

Initializes a new instance of the MySqlDataAdapter class.

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.1.1 MySqlDataAdapter Constructor ()

Initializes a new instance of the MySqlDataAdapter class.

Syntax: Visual Basic

Overloads Public Sub New()

Syntax: C#

public MySqlDataAdapter();

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace, MySqlDataAdapter Constructor Overload List

10.1.7.1.1.2 MySqlDataAdapter Constructor (MySqlCommand)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal selectCommand As MySqlCommand _
)

Syntax: C#

public MySqlDataAdapter(
   MySqlCommand selectCommand
);

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace, MySqlDataAdapter Constructor Overload List

10.1.7.1.1.3 MySqlDataAdapter Constructor (string, MySqlConnection)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal selectCommandText As String, _
   ByVal connection As MySqlConnection _
)

Syntax: C#

public MySqlDataAdapter(
   string selectCommandText,
   MySqlConnection connection
);

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace, MySqlDataAdapter Constructor Overload List

10.1.7.1.1.4 MySqlDataAdapter Constructor (string, string)

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal selectCommandText As String, _
   ByVal selectConnString As String _
)

Syntax: C#

public MySqlDataAdapter(
   string selectCommandText,
   string selectConnString
);

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace, MySqlDataAdapter Constructor Overload List

10.1.7.1.2 DeleteCommand Property

Syntax: Visual Basic

Overloads Public Property DeleteCommand As MySqlCommand

Syntax: C#

new public MySqlCommand DeleteCommand {get; set;}

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.3 InsertCommand Property

Syntax: Visual Basic

Overloads Public Property InsertCommand As MySqlCommand

Syntax: C#

new public MySqlCommand InsertCommand {get; set;}

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.4 SelectCommand Property

Syntax: Visual Basic

Overloads Public Property SelectCommand As MySqlCommand

Syntax: C#

new public MySqlCommand SelectCommand {get; set;}

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.5 UpdateCommand Property

Syntax: Visual Basic

Overloads Public Property UpdateCommand As MySqlCommand

Syntax: C#

new public MySqlCommand UpdateCommand {get; set;}

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.6 MySqlDataAdapter.RowUpdated Event

Occurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires.

Syntax: Visual Basic

Public Event RowUpdated As MySqlRowUpdatedEventHandler

Syntax: C#

public event MySqlRowUpdatedEventHandler RowUpdated;

Event Data

The event handler receives an argument of type MySqlRowUpdatedEventArgs containing data related to this event. The following MySqlRowUpdatedEventArgsproperties provide information specific to this event.

PropertyDescription
CommandGets or sets the MySqlCommand executed when Update is called.
ErrorsGets any errors generated by the .NET Framework data provider when the Commandwas executed.
RecordsAffectedGets the number of rows changed, inserted, or deleted by execution of the SQL statement.
RowGets the DataRowsent through an Update.
RowCountGets the number of rows processed in a batch of updated records.
StatementTypeGets the type of SQL statement executed.
StatusGets the UpdateStatus of the Commandproperty.
TableMappingGets the DataTableMappingsent through an Update.

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.7.1.7 MySqlDataAdapter.RowUpdating Event

Occurs during Update before a command is executed against the data source. The attempt to update is made, so the event fires.

Syntax: Visual Basic

Public Event RowUpdating As MySqlRowUpdatingEventHandler

Syntax: C#

public event MySqlRowUpdatingEventHandler RowUpdating;

Event Data

The event handler receives an argument of type MySqlRowUpdatingEventArgs containing data related to this event. The following MySqlRowUpdatingEventArgsproperties provide information specific to this event.

PropertyDescription
CommandGets or sets the MySqlCommand to execute when performing the Update.
ErrorsGets any errors generated by the .NET Framework data provider when the Command executes.
RowGets the DataRow that will be sent to the server as part of an insert, update, or delete operation.
StatementTypeGets the type of SQL statement to execute.
StatusGets or sets the UpdateStatus of the Commandproperty.
TableMappingGets the DataTableMapping to send through the Update.

See Also

MySqlDataAdapter Class, MySql.Data.MySqlClient Namespace

10.1.8 MySqlDataReader Class

Provides a means of reading a forward-only stream of rows from a MySQL database. This class cannot be inherited.

For a list of all members of this type, see MySqlDataReader Members.

Syntax: Visual Basic

NotInheritable Public Class MySqlDataReader_
  Inherits MarshalByRefObject_
  Implements IEnumerable, IDataReader, IDisposable, IDataRecord

Syntax: C#

public sealed class MySqlDataReader : MarshalByRefObject, IEnumerable, IDataReader, IDisposable, IDataRecord

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlDataReader Members, MySql.Data.MySqlClient Namespace

10.1.8.1 MySqlDataReader Members

MySqlDataReader overview

Public Instance Properties

DepthGets a value indicating the depth of nesting for the current row. This method is not supported currently and always returns 0.
FieldCountGets the number of columns in the current row.
HasRowsGets a value indicating whether the MySqlDataReader contains one or more rows.
IsClosedGets a value indicating whether the data reader is closed.
ItemOverloaded. Overloaded. Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.
RecordsAffectedGets the number of rows changed, inserted, or deleted by execution of the SQL statement.

Public Instance Methods

CloseCloses the MySqlDataReader object.
CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetBooleanGets the value of the specified column as a Boolean.
GetByteGets the value of the specified column as a byte.
GetBytesReads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset.
GetCharGets the value of the specified column as a single character.
GetCharsReads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset.
GetDataTypeNameGets the name of the source data type.
GetDateTime 
GetDecimal 
GetDouble 
GetFieldTypeGets the Type that is the data type of the object.
GetFloat 
GetGuid 
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInt16 
GetInt32 
GetInt64 
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetMySqlDateTime 
GetNameGets the name of the specified column.
GetOrdinalGets the column ordinal, given the name of the column.
GetSchemaTableReturns a DataTable that describes the column metadata of the MySqlDataReader.
GetString 
GetTimeSpan 
GetType (inherited from Object)Gets the Type of the current instance.
GetUInt16 
GetUInt32 
GetUInt64 
GetValueGets the value of the specified column in its native format.
GetValuesGets all attribute columns in the collection for the current row.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
IsDBNullGets a value indicating whether the column contains non-existent or missing values.
NextResultAdvances the data reader to the next result, when reading the results of batch SQL statements.
ReadAdvances the MySqlDataReader to the next record.
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.1 Depth Property

Gets a value indicating the depth of nesting for the current row. This method is not supported currently and always returns 0.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property Depth As Integer _
  Implements IDataReader.Depth

Syntax: C#

public int Depth {get;}

Implements

IDataReader.Depth

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.2 FieldCount Property

Gets the number of columns in the current row.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property FieldCount As Integer _
  Implements IDataRecord.FieldCount

Syntax: C#

public int FieldCount {get;}

Implements

IDataRecord.FieldCount

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.3 HasRows Property

Gets a value indicating whether the MySqlDataReader contains one or more rows.

Syntax: Visual Basic

Public ReadOnly Property HasRows As Boolean

Syntax: C#

public bool HasRows {get;}

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.4 IsClosed Property

Gets a value indicating whether the data reader is closed.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property IsClosed As Boolean _
  Implements IDataReader.IsClosed

Syntax: C#

public bool IsClosed {get;}

Implements

IDataReader.IsClosed

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.5 Item Property

Overloaded. Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

Overload List

Overloaded. Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.5.1 Item Property (Int32)

Overloaded. Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

Syntax: Visual Basic

NotOverridable Overloads Public Default ReadOnly Property Item( _
   ByVal i As Integer _
) _
  Implements IDataRecord.Item As Object _
  Implements IDataRecord.Item

Syntax: C#

public object this[
   int i
] {get;}

Implements

IDataRecord.Item

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace, MySqlDataReader.Item Overload List

10.1.8.1.5.2 Item Property (String)

Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

Syntax: Visual Basic

NotOverridable Overloads Public Default ReadOnly Property Item( _
   ByVal name As String _
) _
  Implements IDataRecord.Item As Object _
  Implements IDataRecord.Item

Syntax: C#

public object this[
   string name
] {get;}

Implements

IDataRecord.Item

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace, MySqlDataReader.Item Overload List

10.1.8.1.6 RecordsAffected Property

Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property RecordsAffected As Integer _
  Implements IDataReader.RecordsAffected

Syntax: C#

public int RecordsAffected {get;}

Implements

IDataReader.RecordsAffected

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.7 MySqlDataReader.Close Method

Closes the MySqlDataReader object.

Syntax: Visual Basic

NotOverridable Public Sub Close() _
  Implements IDataReader.Close

Syntax: C#

public void Close();

Implements

IDataReader.Close

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.8 MySqlDataReader.GetBoolean Method

Gets the value of the specified column as a Boolean.

Syntax: Visual Basic

NotOverridable Public Function GetBoolean( _
   ByVal i As Integer _
) As Boolean _
  Implements IDataRecord.GetBoolean

Syntax: C#

public bool GetBoolean(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetBoolean

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.9 MySqlDataReader.GetByte Method

Gets the value of the specified column as a byte.

Syntax: Visual Basic

NotOverridable Public Function GetByte( _
   ByVal i As Integer _
) As Byte _
  Implements IDataRecord.GetByte

Syntax: C#

public byte GetByte(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetByte

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.10 MySqlDataReader.GetBytes Method

Reads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset.

Syntax: Visual Basic

NotOverridable Public Function GetBytes( _
   ByVal i As Integer, _
   ByVal dataIndex As Long, _
   ByVal buffer As Byte(), _
   ByVal bufferIndex As Integer, _
   ByVal length As Integer _
) As Long _
  Implements IDataRecord.GetBytes

Syntax: C#

public long GetBytes(
   int i,
   long dataIndex,
   byte[] buffer,
   int bufferIndex,
   int length
);

Parameters

  • i: The zero-based column ordinal.

  • dataIndex: The index within the field from which to begin the read operation.

  • buffer: The buffer into which to read the stream of bytes.

  • bufferIndex: The index for buffer to begin the read operation.

  • length: The maximum length to copy into the buffer.

Return Value

The actual number of bytes read.

Implements

IDataRecord.GetBytes

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.11 MySqlDataReader.GetChar Method

Gets the value of the specified column as a single character.

Syntax: Visual Basic

NotOverridable Public Function GetChar( _
   ByVal i As Integer _
) As Char _
  Implements IDataRecord.GetChar

Syntax: C#

public char GetChar(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetChar

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.12 MySqlDataReader.GetChars Method

Reads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset.

Syntax: Visual Basic

NotOverridable Public Function GetChars( _
   ByVal i As Integer, _
   ByVal fieldOffset As Long, _
   ByVal buffer As Char(), _
   ByVal bufferoffset As Integer, _
   ByVal length As Integer _
) As Long _
  Implements IDataRecord.GetChars

Syntax: C#

public long GetChars(
   int i,
   long fieldOffset,
   char[] buffer,
   int bufferoffset,
   int length
);

Parameters

  • i:

  • fieldOffset:

  • buffer:

  • bufferoffset:

  • length:

Return Value

Implements

IDataRecord.GetChars

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.13 MySqlDataReader.GetDataTypeName Method

Gets the name of the source data type.

Syntax: Visual Basic

NotOverridable Public Function GetDataTypeName( _
   ByVal i As Integer _
) As String _
  Implements IDataRecord.GetDataTypeName

Syntax: C#

public string GetDataTypeName(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetDataTypeName

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.14 MySqlDataReader.GetDateTime Method

Syntax: Visual Basic

NotOverridable Public Function GetDateTime( _
   ByVal index As Integer _
) As Date _
  Implements IDataRecord.GetDateTime

Syntax: C#

public DateTime GetDateTime(
   int index
);

Implements

IDataRecord.GetDateTime

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.15 MySqlDataReader.GetDecimal Method

Syntax: Visual Basic

NotOverridable Public Function GetDecimal( _
   ByVal index As Integer _
) As Decimal _
  Implements IDataRecord.GetDecimal

Syntax: C#

public decimal GetDecimal(
   int index
);

Implements

IDataRecord.GetDecimal

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.16 MySqlDataReader.GetDouble Method

Syntax: Visual Basic

NotOverridable Public Function GetDouble( _
   ByVal index As Integer _
) As Double _
  Implements IDataRecord.GetDouble

Syntax: C#

public double GetDouble(
   int index
);

Implements

IDataRecord.GetDouble

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.17 MySqlDataReader.GetFieldType Method

Gets the Type that is the data type of the object.

Syntax: Visual Basic

NotOverridable Public Function GetFieldType( _
   ByVal i As Integer _
) As Type _
  Implements IDataRecord.GetFieldType

Syntax: C#

public Type GetFieldType(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetFieldType

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.18 MySqlDataReader.GetFloat Method

Syntax: Visual Basic

NotOverridable Public Function GetFloat( _
   ByVal index As Integer _
) As Single _
  Implements IDataRecord.GetFloat

Syntax: C#

public float GetFloat(
   int index
);

Implements

IDataRecord.GetFloat

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.19 MySqlDataReader.GetGuid Method

Syntax: Visual Basic

NotOverridable Public Function GetGuid( _
   ByVal index As Integer _
) As Guid _
  Implements IDataRecord.GetGuid

Syntax: C#

public Guid GetGuid(
   int index
);

Implements

IDataRecord.GetGuid

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.20 MySqlDataReader.GetInt16 Method

Syntax: Visual Basic

NotOverridable Public Function GetInt16( _
   ByVal index As Integer _
) As Short _
  Implements IDataRecord.GetInt16

Syntax: C#

public short GetInt16(
   int index
);

Implements

IDataRecord.GetInt16

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.21 MySqlDataReader.GetInt32 Method

Syntax: Visual Basic

NotOverridable Public Function GetInt32( _
   ByVal index As Integer _
) As Integer _
  Implements IDataRecord.GetInt32

Syntax: C#

public int GetInt32(
   int index
);

Implements

IDataRecord.GetInt32

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.22 MySqlDataReader.GetInt64 Method

Syntax: Visual Basic

NotOverridable Public Function GetInt64( _
   ByVal index As Integer _
) As Long _
  Implements IDataRecord.GetInt64

Syntax: C#

public long GetInt64(
   int index
);

Implements

IDataRecord.GetInt64

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.23 MySqlDataReader.GetMySqlDateTime Method

Syntax: Visual Basic

Public Function GetMySqlDateTime( _
   ByVal index As Integer _
) As MySqlDateTime

Syntax: C#

public MySqlDateTime GetMySqlDateTime(
   int index
);

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.24 MySqlDataReader.GetName Method

Gets the name of the specified column.

Syntax: Visual Basic

NotOverridable Public Function GetName( _
   ByVal i As Integer _
) As String _
  Implements IDataRecord.GetName

Syntax: C#

public string GetName(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetName

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.25 MySqlDataReader.GetOrdinal Method

Gets the column ordinal, given the name of the column.

Syntax: Visual Basic

NotOverridable Public Function GetOrdinal( _
   ByVal name As String _
) As Integer _
  Implements IDataRecord.GetOrdinal

Syntax: C#

public int GetOrdinal(
   string name
);

Parameters

  • name:

Return Value

Implements

IDataRecord.GetOrdinal

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.26 MySqlDataReader.GetSchemaTable Method

Returns a DataTable that describes the column metadata of the MySqlDataReader.

Syntax: Visual Basic

NotOverridable Public Function GetSchemaTable() As DataTable _
  Implements IDataReader.GetSchemaTable

Syntax: C#

public DataTable GetSchemaTable();

Return Value

Implements

IDataReader.GetSchemaTable

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.27 MySqlDataReader.GetString Method

Syntax: Visual Basic

NotOverridable Public Function GetString( _
   ByVal index As Integer _
) As String _
  Implements IDataRecord.GetString

Syntax: C#

public string GetString(
   int index
);

Implements

IDataRecord.GetString

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.28 MySqlDataReader.GetTimeSpan Method

Syntax: Visual Basic

Public Function GetTimeSpan( _
   ByVal index As Integer _
) As TimeSpan

Syntax: C#

public TimeSpan GetTimeSpan(
   int index
);

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.29 MySqlDataReader.GetUInt16 Method

Syntax: Visual Basic

Public Function GetUInt16( _
   ByVal index As Integer _
) As UInt16

Syntax: C#

public ushort GetUInt16(
   int index
);

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.30 MySqlDataReader.GetUInt32 Method

Syntax: Visual Basic

Public Function GetUInt32( _
   ByVal index As Integer _
) As UInt32

Syntax: C#

public uint GetUInt32(
   int index
);

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.31 MySqlDataReader.GetUInt64 Method

Syntax: Visual Basic

Public Function GetUInt64( _
   ByVal index As Integer _
) As UInt64

Syntax: C#

public ulong GetUInt64(
   int index
);

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.32 MySqlDataReader.GetValue Method

Gets the value of the specified column in its native format.

Syntax: Visual Basic

NotOverridable Public Function GetValue( _
   ByVal i As Integer _
) As Object _
  Implements IDataRecord.GetValue

Syntax: C#

public object GetValue(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.GetValue

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.33 MySqlDataReader.GetValues Method

Gets all attribute columns in the collection for the current row.

Syntax: Visual Basic

NotOverridable Public Function GetValues( _
   ByVal values As Object() _
) As Integer _
  Implements IDataRecord.GetValues

Syntax: C#

public int GetValues(
   object[] values
);

Parameters

  • values:

Return Value

Implements

IDataRecord.GetValues

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.34 MySqlDataReader.IsDBNull Method

Gets a value indicating whether the column contains non-existent or missing values.

Syntax: Visual Basic

NotOverridable Public Function IsDBNull( _
   ByVal i As Integer _
) As Boolean _
  Implements IDataRecord.IsDBNull

Syntax: C#

public bool IsDBNull(
   int i
);

Parameters

  • i:

Return Value

Implements

IDataRecord.IsDBNull

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.35 MySqlDataReader.NextResult Method

Advances the data reader to the next result, when reading the results of batch SQL statements.

Syntax: Visual Basic

NotOverridable Public Function NextResult() As Boolean _
  Implements IDataReader.NextResult

Syntax: C#

public bool NextResult();

Return Value

Implements

IDataReader.NextResult

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.8.1.36 MySqlDataReader.Read Method

Advances the MySqlDataReader to the next record.

Syntax: Visual Basic

NotOverridable Public Function Read() As Boolean _
  Implements IDataReader.Read

Syntax: C#

public bool Read();

Return Value

Implements

IDataReader.Read

See Also

MySqlDataReader Class, MySql.Data.MySqlClient Namespace

10.1.9 MySqlDbType Enumeration

Specifies MySQL-specific data type of a field, property, for use in a MySqlParameter.

Syntax: Visual Basic

Public Enum MySqlDbType

Syntax: C#

public enum MySqlDbType

Members

Member NameDescription
NewdateObsolete. Use Datetime or Date type.
TimestampA timestamp. The range is '1970-01-01 00:00:01.000000' to '2038-01-19 03:14:07.999999'. (Fractional seconds can only be stored with a MySQL 5.6.4 or higher database server.)
Time

The range is '-838:59:59.000000' to '838:59:59.000000'. (Fractional seconds can only be stored with a MySQL 5.6.4 or higher database server.)

DateThe supported range is '1000-01-01' to '9999-12-31'.
DatetimeThe supported range is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999'. (Fractional seconds can only be stored with a MySQL 5.6.4 or higher database server.)
YearA year in 2- or 4-digit format (default is 4-digit). The allowable values are 1901 to 2155, 0000 in the 4-digit year format, and 1970-2069 if you use the 2-digit format (70-69).
TinyBlobA BLOB column with a maximum length of 255 (2^8 - 1) characters.
BlobA BLOB column with a maximum length of 65535 (2^16 - 1) characters.
MediumBlobA BLOB column with a maximum length of 16777215 (2^24 - 1) characters.
LongBlobA BLOB column with a maximum length of 4294967295 or 4G (2^32 - 1) characters.
Int16

A 16-bit signed integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.

Int24Specifies a 24 (3 byte) signed or unsigned value.
Int32

A 32-bit signed integer.

Int64

A 64-bit signed integer.

Byte

The signed range is -128 to 127. The unsigned range is 0 to 255.

Float

A small (single-precision) floating-point number. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38.

Double

A normal-size (double-precision) floating-point number. Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 1.7976931348623157E+308.

UByteAn 8-bit unsigned value.
UInt16A 16-bit unsigned value.
UInt24A 24-bit unsigned value.
UInt32A 32-bit unsigned value.
UInt64A 64-bit unsigned value.
Decimal

A fixed precision and scale numeric value between -10^38-1 and 10^38-1.

NewDecimalNew Decimal
SetA set. A string object that can have zero or more values, each of which must be chosen from the list of values 'value1', 'value2', ... A SET can have a maximum of 64 members.
StringObsolete. Use VarChar type.
VarCharA variable-length string containing 0 to 255 characters.
VarStringA variable-length string containing 0 to 65535 characters.
EnumAn enumeration. A string object that can have only one value, chosen from the list of values 'value1', 'value2', ..., NULL or the special "" error value. An ENUM can have a maximum of 65535 distinct values.
Geometry 
BitBit-field data type.
TinyTextA nonbinary string column supporting a maximum length of 255 (2^8 - 1) characters.
TextA nonbinary string column supporting a maximum length of 65535 (2^16 - 1) characters.
MediumTextA nonbinary string column supporting a maximum length of 16777215 (2^24 - 1) characters.
LongTextA nonbinary string column supporting a maximum length of 4294967295 (2^32 - 1) characters.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySql.Data.MySqlClient Namespace

10.1.10 MySqlError Class

Collection of error codes that can be returned by the server

For a list of all members of this type, see MySqlError Members.

Syntax: Visual Basic

Public Class MySqlError

Syntax: C#

public class MySqlError

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlError Members, MySql.Data.MySqlClient Namespace

10.1.10.1 MySqlError Members

MySqlError overview

Public Instance Constructors

Public Instance Properties

CodeError code
LevelError level
MessageError message

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

MySqlError Class, MySql.Data.MySqlClient Namespace

10.1.10.1.1 MySqlError Constructor

Syntax: Visual Basic

Public Sub New( _
   ByVal level As String, _
   ByVal code As Integer, _
   ByVal message As String _
)

Syntax: C#

public MySqlError(
   string level,
   int code,
   string message
);

Parameters

  • level:

  • code:

  • message:

See Also

MySqlError Class, MySql.Data.MySqlClient Namespace

10.1.10.1.2 Code Property

Error code

Syntax: Visual Basic

Public ReadOnly Property Code As Integer

Syntax: C#

public int Code {get;}

See Also

MySqlError Class, MySql.Data.MySqlClient Namespace

10.1.10.1.3 Level Property

Error level

Syntax: Visual Basic

Public ReadOnly Property Level As String

Syntax: C#

public string Level {get;}

See Also

MySqlError Class, MySql.Data.MySqlClient Namespace

10.1.10.1.4 Message Property

Error message

Syntax: Visual Basic

Public ReadOnly Property Message As String

Syntax: C#

public string Message {get;}

See Also

MySqlError Class, MySql.Data.MySqlClient Namespace

10.1.11 MySqlErrorCode Enumeration

Syntax: Visual Basic

Public Enum MySqlErrorCode

Syntax: C#

public enum MySqlErrorCode

Members

Member NameDescription
PacketTooLarge 
PasswordNotAllowed 
DuplicateKeyEntry 
HostNotPrivileged 
PasswordNoMatch 
AnonymousUser 
DuplicateKey 
KeyNotFound 
DuplicateKeyName 

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySql.Data.MySqlClient Namespace

10.1.12 MySqlException Class

The exception that is thrown when MySQL returns an error. This class cannot be inherited.

For a list of all members of this type, see MySqlException Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlException _
  Inherits SystemException

Syntax: C#

public sealed class MySqlException : SystemException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlException Members, MySql.Data.MySqlClient Namespace

10.1.12.1 MySqlException Members

MySqlException overview

Public Instance Properties

Data (inherited from Exception)Gets a collection of key/value pairs that provide additional, user-defined information about the exception.
HelpLink (inherited from Exception)Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception)Gets the Exceptioninstance that caused the current exception.
Message (inherited from Exception)Gets a message that describes the current exception.
NumberGets a number that identifies the type of error. This number corresponds to the error numbers given in Server Error Codes and Messages.
Source (inherited from Exception)Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception)Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception)Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception)When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from Exception)When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception)Gets the runtime type of the current instance.
ToString (inherited from Exception)Creates and returns a string representation of the current exception.

See Also

MySqlException Class, MySql.Data.MySqlClient Namespace

10.1.12.1.1 Number Property

Gets a number that identifies the type of error.

Syntax: Visual Basic

Public ReadOnly Property Number As Integer

Syntax: C#

public int Number {get;}

See Also

MySqlException Class, MySql.Data.MySqlClient Namespace

10.1.13 MySqlHelper Class

Helper class that makes it easier to work with the provider.

For a list of all members of this type, see MySqlHelper Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlHelper

Syntax: C#

public sealed class MySqlHelper

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlHelper Members, MySql.Data.MySqlClient Namespace

10.1.13.1 MySqlHelper Members

MySqlHelper overview

Public Static (Shared) Methods

ExecuteDataRowExecutes a single SQL statement and returns the first row of the resultset. A new MySqlConnection object is created, opened, and closed during this method.
ExecuteDatasetOverloaded. Executes a single SQL statement and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.
ExecuteNonQueryOverloaded. Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.
ExecuteReaderOverloaded. Executes a single command against a MySQL database.
ExecuteScalarOverloaded. Execute a single command against a MySQL database.
UpdateDataSetUpdates the given table with data from the given DataSet

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.1 MySqlHelper.ExecuteDataRow Method

Executes a single SQL statement and returns the first row of the resultset. A new MySqlConnection object is created, opened, and closed during this method.

Syntax: Visual Basic

Public Shared Function ExecuteDataRow( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ParamArray parms As MySqlParameter() _
) As DataRow

Syntax: C#

public static DataRow ExecuteDataRow(
   string connectionString,
   string commandText,
   params MySqlParameter[]parms
);

Parameters

  • connectionString: Settings to be used for the connection

  • commandText: Command to execute

  • parms: Parameters to use for the command

Return Value

DataRow containing the first row of the resultset

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.2 ExecuteDataset Method

Executes a single SQL statement and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

Overload List

Executes a single SQL statement and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

Executes a single SQL statement and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

Executes a single SQL statement and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.

Executes a single SQL statement and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.2.1 MySqlHelper.ExecuteDataset Method

Executes a single SQL statement and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteDataset( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String _
) As DataSet

Syntax: C#

public static DataSet ExecuteDataset(
   MySqlConnection connection,
   string commandText
);

Parameters

  • connection: MySqlConnection object to use

  • commandText: Command to execute

Return Value

DataSetcontaining the resultset

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteDataset Overload List

10.1.13.1.2.2 MySqlHelper.ExecuteDataset Method

Executes a single SQL statement and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteDataset( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As DataSet

Syntax: C#

public static DataSet ExecuteDataset(
   MySqlConnection connection,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connection: MySqlConnection object to use

  • commandText: Command to execute

  • commandParameters: Parameters to use for the command

Return Value

DataSetcontaining the resultset

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteDataset Overload List

10.1.13.1.2.3 MySqlHelper.ExecuteDataset Method

Executes a single SQL statement and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteDataset( _
   ByVal connectionString As String, _
   ByVal commandText As String _
) As DataSet

Syntax: C#

public static DataSet ExecuteDataset(
   string connectionString,
   string commandText
);

Parameters

  • connectionString: Settings to be used for the connection

  • commandText: Command to execute

Return Value

DataSetcontaining the resultset

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteDataset Overload List

10.1.13.1.2.4 MySqlHelper.ExecuteDataset Method

Executes a single SQL statement and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteDataset( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As DataSet

Syntax: C#

public static DataSet ExecuteDataset(
   string connectionString,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connectionString: Settings to be used for the connection

  • commandText: Command to execute

  • commandParameters: Parameters to use for the command

Return Value

DataSetcontaining the resultset

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteDataset Overload List

10.1.13.1.3 ExecuteNonQuery Method

Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.

Overload List

Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.

Executes a single command against a MySQL database. A new MySqlConnection is created using the ConnectionString given.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.3.1 MySqlHelper.ExecuteNonQuery Method

Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteNonQuery( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As Integer

Syntax: C#

public static int ExecuteNonQuery(
   MySqlConnection connection,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connection: MySqlConnection object to use

  • commandText: SQL statement to be executed

  • commandParameters: Array of MySqlParameter objects to use with the command.

Return Value

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteNonQuery Overload List

10.1.13.1.3.2 MySqlHelper.ExecuteNonQuery Method

Executes a single command against a MySQL database. A new MySqlConnection is created using the ConnectionString given.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteNonQuery( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ParamArray parms As MySqlParameter() _
) As Integer

Syntax: C#

public static int ExecuteNonQuery(
   string connectionString,
   string commandText,
   params MySqlParameter[]parms
);

Parameters

Return Value

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteNonQuery Overload List

10.1.13.1.4 ExecuteReader Method

Executes a single command against a MySQL database.

Overload List

Executes a single command against a MySQL database.

Executes a single command against a MySQL database.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.4.1 MySqlHelper.ExecuteReader Method

Executes a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteReader( _
   ByVal connectionString As String, _
   ByVal commandText As String _
) As MySqlDataReader

Syntax: C#

public static MySqlDataReader ExecuteReader(
   string connectionString,
   string commandText
);

Parameters

  • connectionString: Settings to use for this command

  • commandText: Command text to use

Return Value

MySqlDataReader object ready to read the results of the command

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteReader Overload List

10.1.13.1.4.2 MySqlHelper.ExecuteReader Method

Executes a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteReader( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As MySqlDataReader

Syntax: C#

public static MySqlDataReader ExecuteReader(
   string connectionString,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connectionString: Settings to use for this command

  • commandText: Command text to use

  • commandParameters: Array of MySqlParameter objects to use with the command

Return Value

MySqlDataReader object ready to read the results of the command

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteReader Overload List

10.1.13.1.5 ExecuteScalar Method

Execute a single command against a MySQL database.

Overload List

Execute a single command against a MySQL database.

Execute a single command against a MySQL database.

Execute a single command against a MySQL database.

Execute a single command against a MySQL database.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.13.1.5.1 MySqlHelper.ExecuteScalar Method (MySqlConnection, string)

Execute a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteScalar( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String _
) As Object

Syntax: C#

public static object ExecuteScalar(
   MySqlConnection connection,
   string commandText
);

Parameters

  • connection: MySqlConnection object to use

  • commandText: Command text to use for the command

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteScalar Overload List

10.1.13.1.5.2 MySqlHelper.ExecuteScalar Method (MySqlConnection,string,params MySqlParameter[])

Execute a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteScalar( _
   ByVal connection As MySqlConnection, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As Object

Syntax: C#

public static object ExecuteScalar(
   MySqlConnection connection,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connection: MySqlConnection object to use

  • commandText: Command text to use for the command

  • commandParameters: Parameters to use for the command

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteScalar Overload List

10.1.13.1.5.3 MySqlHelper.ExecuteScalar Method (string, string)

Execute a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteScalar( _
   ByVal connectionString As String, _
   ByVal commandText As String _
) As Object

Syntax: C#

public static object ExecuteScalar(
   string connectionString,
   string commandText
);

Parameters

  • connectionString: Settings to use for the update

  • commandText: Command text to use for the update

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteScalar Overload List

10.1.13.1.5.4 MySqlHelper.ExecuteScalar Method (string, string, params MySqlParameter[])

Execute a single command against a MySQL database.

Syntax: Visual Basic

Overloads Public Shared Function ExecuteScalar( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ParamArray commandParameters As MySqlParameter() _
) As Object

Syntax: C#

public static object ExecuteScalar(
   string connectionString,
   string commandText,
   params MySqlParameter[]commandParameters
);

Parameters

  • connectionString: Settings to use for the command

  • commandText: Command text to use for the command

  • commandParameters: Parameters to use for the command

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace, MySqlHelper.ExecuteScalar Overload List

10.1.13.1.6 MySqlHelper.UpdateDataSet Method

Updates the given table with data from the given DataSet

Syntax: Visual Basic

Public Shared Sub UpdateDataSet( _
   ByVal connectionString As String, _
   ByVal commandText As String, _
   ByVal ds As DataSet, _
   ByVal tablename As String _
)

Syntax: C#

public static void UpdateDataSet(
   string connectionString,
   string commandText,
   DataSet ds,
   string tablename
);

Parameters

  • connectionString: Settings to use for the update

  • commandText: Command text to use for the update

  • ds: DataSetcontaining the new data to use in the update

  • tablename: Tablename in the data set to update

See Also

MySqlHelper Class, MySql.Data.MySqlClient Namespace

10.1.14 MySqlInfoMessageEventArgs Class

Provides data for the InfoMessage event. This class cannot be inherited.

For a list of all members of this type, see MySqlInfoMessageEventArgs Members .

Syntax: Visual Basic

Public Class MySqlInfoMessageEventArgs_
  Inherits EventArgs

Syntax: C#

public class MySqlInfoMessageEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlInfoMessageEventArgs Members, MySql.Data.MySqlClient Namespace

10.1.14.1 MySqlInfoMessageEventArgs Members

MySqlInfoMessageEventArgs overview

Public Instance Constructors

MySqlInfoMessageEventArgs ConstructorInitializes a new instance of the MySqlInfoMessageEventArgs class.

Public Instance Fields

errors 

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

MySqlInfoMessageEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.14.1.1 MySqlInfoMessageEventArgs Constructor

Initializes a new instance of the MySqlInfoMessageEventArgs class.

Syntax: Visual Basic

Public Sub New()

Syntax: C#

public MySqlInfoMessageEventArgs();

See Also

MySqlInfoMessageEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.14.1.2 MySqlInfoMessageEventArgs.errors Field

Syntax: Visual Basic

Public errors As MySqlError()

Syntax: C#

public MySqlError[] errors;

See Also

MySqlInfoMessageEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.15 MySqlInfoMessageEventHandler Delegate

Represents the method that will handle the InfoMessage event of a MySqlConnection.

Syntax: Visual Basic

Public Delegate Sub MySqlInfoMessageEventHandler( _
   ByVal sender As Object, _
   ByVal args As MySqlInfoMessageEventArgs _
)

Syntax: C#

public delegate void MySqlInfoMessageEventHandler(
   object sender,
   MySqlInfoMessageEventArgs args
);

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySql.Data.MySqlClient Namespace

10.1.16 MySqlParameter Class

Represents a parameter to a MySqlCommand, and optionally, its mapping to DataSetcolumns. This class cannot be inherited.

For a list of all members of this type, see MySqlParameter Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlParameter_
  Inherits MarshalByRefObject_
  Implements IDataParameter, IDbDataParameter, ICloneable

Syntax: C#

public sealed class MySqlParameter : MarshalByRefObject, IDataParameter, IDbDataParameter, ICloneable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlParameter Members, MySql.Data.MySqlClient Namespace

10.1.16.1 MySqlParameter Members

MySqlParameter overview

Public Instance Constructors

MySqlParameterOverloaded. Initializes a new instance of the MySqlParameter class.

Public Instance Properties

DbTypeGets or sets the DbType of the parameter.
DirectionGets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. As of MySQL version 4.1 and earlier, input-only is the only valid choice.
IsNullableGets or sets a value indicating whether the parameter accepts null values.
IsUnsigned 
MySqlDbTypeGets or sets the MySqlDbType of the parameter.
ParameterNameGets or sets the name of the MySqlParameter.
PrecisionGets or sets the maximum number of digits used to represent the Value property.
ScaleGets or sets the number of decimal places to which Value is resolved.
SizeGets or sets the maximum size, in bytes, of the data within the column.
SourceColumnGets or sets the name of the source column that is mapped to the DataSetand used for loading or returning the Value.
SourceVersionGets or sets the DataRowVersion to use when loading Value.
ValueGets or sets the value of the parameter.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
ToStringOverridden. Gets a string containing the ParameterName.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.1 MySqlParameter Constructor

Initializes a new instance of the MySqlParameter class.

Overload List

Initializes a new instance of the MySqlParameter class.

Initializes a new instance of the MySqlParameter class with the parameter name and the data type.

Initializes a new instance of the MySqlParameter class with the parameter name, the MySqlDbType, and the size.

Initializes a new instance of the MySqlParameter class with the parameter name, the type of the parameter, the size of the parameter, a ParameterDirection, the precision of the parameter, the scale of the parameter, the source column, a DataRowVersion to use, and the value of the parameter.

Initializes a new instance of the MySqlParameter class with the parameter name, the MySqlDbType, the size, and the source column name.

Initializes a new instance of the MySqlParameter class with the parameter name and a value of the new MySqlParameter.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.1.1 MySqlParameter Constructor ()

Initializes a new instance of the MySqlParameter class.

Syntax: Visual Basic

Overloads Public Sub New()

Syntax: C#

public MySqlParameter();

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.1.2 MySqlParameter Constructor (string, MySqlDbType)

Initializes a new instance of the MySqlParameter class with the parameter name and the data type.

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType _
)

Syntax: C#

public MySqlParameter(
  string parameterName,
  MySqlDbType dbType
);

Parameters

  • parameterName: The name of the parameter to map.

  • dbType: One of the MySqlDbType values.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.1.3 MySqlParameter Constructor (String, MySqlDbType, Int32)

Initializes a new instance of the MySqlParameter class with the parameter name, the MySqlDbType, and the size.

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType, _
   ByVal size As Integer _
)

Syntax: C#

public MySqlParameter(
   string parameterName,
   MySqlDbType dbType,
   int size
);

Parameters

  • parameterName: The name of the parameter to map.

  • dbType: One of the MySqlDbType values.

  • size: The length of the parameter.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.1.4 MySqlParameter Constructor (string, MySqlDbType, int,ParameterDirection, bool, byte, byte, string, DataRowVersion, object)

Initializes a new instance of the MySqlParameter class with the parameter name, the type of the parameter, the size of the parameter, a ParameterDirection, the precision of the parameter, the scale of the parameter, the source column, a DataRowVersion to use, and the value of the parameter.

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType, _
   ByVal size As Integer, _
   ByVal direction As ParameterDirection, _
   ByVal isNullable As Boolean, _
   ByVal precision As Byte, _
   ByVal scale As Byte, _
   ByVal sourceColumn As String, _
   ByVal sourceVersion As DataRowVersion, _
   ByVal value As Object _
)

Syntax: C#

public MySqlParameter(
   string parameterName,
   MySqlDbType dbType,
   int size,
   ParameterDirection direction,
   bool isNullable,
   byte precision,
   byte scale,
   string sourceColumn,
   DataRowVersion sourceVersion,
   object value
);

Parameters

  • parameterName: The name of the parameter to map.

  • dbType: One of the MySqlDbType values.

  • size: The length of the parameter.

  • direction: One of the ParameterDirectionvalues.

  • isNullable: true if the value of the field can be null, otherwise false.

  • precision: The total number of digits to the left and right of the decimal point to which Value is resolved.

  • scale: The total number of decimal places to which Value is resolved.

  • sourceColumn: The name of the source column.

  • sourceVersion: One of the DataRowVersionvalues.

  • value: An Object that is the value of the MySqlParameter.

Exceptions

Exception TypeCondition
ArgumentException 

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.1.5 MySqlParameter Constructor (string, MySqlDbType, int, string)

Initializes a new instance of the MySqlParameter class with the parameter name, the MySqlDbType, the size, and the source column name.

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType, _
   ByVal size As Integer, _
   ByVal sourceColumn As String _
)

Syntax: C#

public MySqlParameter(
   string parameterName,
   MySqlDbType dbType,
   int size,
   string sourceColumn
);

Parameters

  • parameterName: The name of the parameter to map.

  • dbType: One of the MySqlDbType values.

  • size: The length of the parameter.

  • sourceColumn: The name of the source column.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.1.6 MySqlParameter Constructor (string, object)

Initializes a new instance of the MySqlParameter class with the parameter name and a value of the new MySqlParameter.

Syntax: Visual Basic

Overloads Public Sub New( _
   ByVal parameterName As String, _
   ByVal value As Object _
)

Syntax: C#

public MySqlParameter(
   string parameterName,
   object value
);

Parameters

  • parameterName: The name of the parameter to map.

  • value: An Object that is the value of the MySqlParameter.

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace, MySqlParameter Constructor Overload List

10.1.16.1.2 DbType Property

Gets or sets the DbType of the parameter.

Syntax: Visual Basic

NotOverridable Public Property DbType As DbType _
  Implements IDataParameter.DbType

Syntax: C#

public System.Data.DbType DbType {get; set;}

Implements

IDataParameter.DbType

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.3 Direction Property

Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. As of MySQL version 4.1 and earlier, input-only is the only valid choice.

Syntax: Visual Basic

NotOverridable Public Property Direction As ParameterDirection _
  Implements IDataParameter.Direction

Syntax: C#

public System.Data.ParameterDirection Direction {get; set;}

Implements

IDataParameter.Direction

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.4 IsNullable Property

Gets or sets a value indicating whether the parameter accepts null values.

Syntax: Visual Basic

NotOverridable Public Property IsNullable As Boolean _
  Implements IDataParameter.IsNullable

Syntax: C#

public bool IsNullable {get; set;}

Implements

IDataParameter.IsNullable

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.5 IsUnsigned Property

Syntax: Visual Basic

Public Property IsUnsigned As Boolean

Syntax: C#

public bool IsUnsigned {get; set;}

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.6 MySqlDbType Property

Gets or sets the MySqlDbType of the parameter.

Syntax: Visual Basic

Public Property MySqlDbType As MySqlDbType

Syntax: C#

public MySqlDbType MySqlDbType {get; set;}

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.7 ParameterName Property

Gets or sets the name of the MySqlParameter.

Syntax: Visual Basic

NotOverridable Public Property ParameterName As String _
  Implements IDataParameter.ParameterName

Syntax: C#

public string ParameterName {get; set;}

Implements

IDataParameter.ParameterName

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.8 Precision Property

Gets or sets the maximum number of digits used to represent the Value property.

Syntax: Visual Basic

NotOverridable Public Property Precision As Byte _
  Implements IDbDataParameter.Precision

Syntax: C#

public byte Precision {get; set;}

Implements

IDbDataParameter.Precision

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.9 Scale Property

Gets or sets the number of decimal places to which Value is resolved.

Syntax: Visual Basic

NotOverridable Public Property Scale As Byte _
  Implements IDbDataParameter.Scale

Syntax: C#

public byte Scale {get; set;}

Implements

IDbDataParameter.Scale

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.10 Size Property

Gets or sets the maximum size, in bytes, of the data within the column.

Syntax: Visual Basic

NotOverridable Public Property Size As Integer _
  Implements IDbDataParameter.Size

Syntax: C#

public int Size {get; set;}

Implements

IDbDataParameter.Size

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.11 SourceColumn Property

Gets or sets the name of the source column that is mapped to the DataSetand used for loading or returning the Value.

Syntax: Visual Basic

NotOverridable Public Property SourceColumn As String _
  Implements IDataParameter.SourceColumn

Syntax: C#

public string SourceColumn {get; set;}

Implements

IDataParameter.SourceColumn

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.12 SourceVersion Property

Gets or sets the DataRowVersion to use when loading Value.

Syntax: Visual Basic

NotOverridable Public Property SourceVersion As DataRowVersion _
  Implements IDataParameter.SourceVersion

Syntax: C#

public System.Data.DataRowVersion SourceVersion {get; set;}

Implements

IDataParameter.SourceVersion

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.13 Value Property

Gets or sets the value of the parameter.

Syntax: Visual Basic

NotOverridable Public Property Value As Object _
  Implements IDataParameter.Value

Syntax: C#

public object Value {get; set;}

Implements

IDataParameter.Value

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.16.1.14 MySqlParameter.ToString Method

Overridden. Gets a string containing the ParameterName.

Syntax: Visual Basic

Overrides Public Function ToString() As String

Syntax: C#

public override string ToString();

Return Value

See Also

MySqlParameter Class, MySql.Data.MySqlClient Namespace

10.1.17 MySqlParameterCollection Class

Represents a collection of parameters relevant to a MySqlCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited.

For a list of all members of this type, see MySqlParameterCollection Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlParameterCollection_
  Inherits MarshalByRefObject_
  Implements IDataParameterCollection, IList, ICollection, IEnumerable

Syntax: C#

public sealed class MySqlParameterCollection : MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlParameterCollection Members, MySql.Data.MySqlClient Namespace

10.1.17.1 MySqlParameterCollection Members

MySqlParameterCollection overview

Public Instance Constructors

MySqlParameterCollection ConstructorInitializes a new instance of the MySqlParameterCollection class.

Public Instance Properties

CountGets the number of MySqlParameter objects in the collection.
ItemOverloaded. Gets the MySqlParameter with a specified attribute. In C#, this property is the indexer for the MySqlParameterCollection class.

Public Instance Methods

AddOverloaded. Adds the specified MySqlParameter object to the MySqlParameterCollection.
ClearRemoves all items from the collection.
ContainsOverloaded. Gets a value indicating whether a MySqlParameter exists in the collection.
CopyToCopies MySqlParameter objects from the MySqlParameterCollection to the specified array.
CreateObjRef (inherited from MarshalByRefObject)Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject)Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object)Gets the Type of the current instance.
IndexOfOverloaded. Gets the location of a MySqlParameter in the collection.
InitializeLifetimeService (inherited from MarshalByRefObject)Obtains a lifetime service object to control the lifetime policy for this instance.
InsertInserts a MySqlParameter into the collection at the specified index.
RemoveRemoves the specified MySqlParameter from the collection.
RemoveAtOverloaded. Removes the specified MySqlParameter from the collection.
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.1 MySqlParameterCollection Constructor

Initializes a new instance of the MySqlParameterCollection class.

Syntax: Visual Basic

Public Sub New()

Syntax: C#

public MySqlParameterCollection();

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.2 Count Property

Gets the number of MySqlParameter objects in the collection.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property Count As Integer _
  Implements ICollection.Count

Syntax: C#

public int Count {get;}

Implements

ICollection.Count

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.3 Item Property

Gets the MySqlParameter with a specified attribute. In C#, this property is the indexer for the MySqlParameterCollection class.

Overload List

Gets the MySqlParameter at the specified index.

Gets the MySqlParameter with the specified name.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.3.1 Item Property (Int32)

Gets the MySqlParameter at the specified index.

Syntax: Visual Basic

Overloads Public Default Property Item( _
   ByVal index As Integer _
) As MySqlParameter

Syntax: C#

public MySqlParameter this[
   int index
] {get; set;}

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Item Overload List

10.1.17.1.3.2 Item Property (String)

Gets the MySqlParameter with the specified name.

Syntax: Visual Basic

Overloads Public Default Property Item( _
   ByVal name As String _
) As MySqlParameter

Syntax: C#

public MySqlParameter this[
   string name
] {get; set;}

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Item Overload List

10.1.17.1.4 Add Method

Adds the specified MySqlParameter object to the MySqlParameterCollection.

Overload List

Adds the specified MySqlParameter object to the MySqlParameterCollection.

Adds the specified MySqlParameter object to the MySqlParameterCollection.

Adds a MySqlParameter to the MySqlParameterCollection given the parameter name and the data type.

Adds a MySqlParameter to the MySqlParameterCollection with the parameter name, the data type, and the column length.

Adds a MySqlParameter to the MySqlParameterCollection with the parameter name, the data type, the column length, and the source column name.

Adds a MySqlParameter to the MySqlParameterCollection given the specified parameter name and value.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.4.1 MySqlParameterCollection.Add Method

Adds the specified MySqlParameter object to the MySqlParameterCollection.

Syntax: Visual Basic

Overloads Public Function Add( _
   ByVal value As MySqlParameter _
) As MySqlParameter

Syntax: C#

public MySqlParameter Add(
   MySqlParameter value
);

Parameters

Return Value

The newly added MySqlParameter object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.4.2 MySqlParameterCollection.Add Method

Adds the specified MySqlParameter object to the MySqlParameterCollection.

Syntax: Visual Basic

NotOverridable Overloads Public Function Add( _
   ByVal value As Object _
) As Integer _
  Implements IList.Add

Syntax: C#

public int Add(
   object value
);

Parameters

Return Value

The index of the new MySqlParameter object.

Implements

IList.Add

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.4.3 MySqlParameterCollection.Add Method

Adds a MySqlParameter to the MySqlParameterCollection given the parameter name and the data type.

Syntax: Visual Basic

Overloads Public Function Add( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType _
) As MySqlParameter

Syntax: C#

public MySqlParameter Add(
   string parameterName,
   MySqlDbType dbType
);

Parameters

  • parameterName: The name of the parameter.

  • dbType: One of the MySqlDbType values.

Return Value

The newly added MySqlParameter object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.4.4 MySqlParameterCollection.Add Method

Adds a MySqlParameter to the MySqlParameterCollection with the parameter name, the data type, and the column length.

Syntax: Visual Basic

Overloads Public Function Add( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType, _
   ByVal size As Integer _
) As MySqlParameter

Syntax: C#

public MySqlParameter Add(
   string parameterName,
   MySqlDbType dbType,
   int size
);

Parameters

  • parameterName: The name of the parameter.

  • dbType: One of the MySqlDbType values.

  • size: The length of the column.

Return Value

The newly added MySqlParameter object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.4.5 MySqlParameterCollection.Add Method

Adds a MySqlParameter to the MySqlParameterCollection with the parameter name, the data type, the column length, and the source column name.

Syntax: Visual Basic

Overloads Public Function Add( _
   ByVal parameterName As String, _
   ByVal dbType As MySqlDbType, _
   ByVal size As Integer, _
   ByVal sourceColumn As String _
) As MySqlParameter

Syntax: C#

public MySqlParameter Add(
   string parameterName,
   MySqlDbType dbType,
   int size,
   string sourceColumn
);

Parameters

  • parameterName: The name of the parameter.

  • dbType: One of the MySqlDbType values.

  • size: The length of the column.

  • sourceColumn: The name of the source column.

Return Value

The newly added MySqlParameter object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.4.6 MySqlParameterCollection.Add Method

Adds a MySqlParameter to the MySqlParameterCollection given the specified parameter name and value.

Syntax: Visual Basic

Overloads Public Function Add( _
   ByVal parameterName As String, _
   ByVal value As Object _
) As MySqlParameter

Syntax: C#

public MySqlParameter Add(
   string parameterName,
   object value
);

Parameters

  • parameterName: The name of the parameter.

  • value: The Value of the MySqlParameter to add to the collection.

Return Value

The newly added MySqlParameter object.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Add Overload List

10.1.17.1.5 MySqlParameterCollection.Clear Method

Removes all items from the collection.

Syntax: Visual Basic

NotOverridable Public Sub Clear() _
  Implements IList.Clear

Syntax: C#

public void Clear();

Implements

IList.Clear

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.6 Contains Method

Gets a value indicating whether a MySqlParameter exists in the collection.

Overload List

Gets a value indicating whether a MySqlParameter exists in the collection.

Gets a value indicating whether a MySqlParameter with the specified parameter name exists in the collection.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.6.1 MySqlParameterCollection.Contains Method

Gets a value indicating whether a MySqlParameter exists in the collection.

Syntax: Visual Basic

NotOverridable Overloads Public Function Contains( _
   ByVal value As Object _
) As Boolean _
  Implements IList.Contains

Syntax: C#

public bool Contains(
   object value
);

Parameters

Return Value

true if the collection contains the MySqlParameter object; otherwise, false.

Implements

IList.Contains

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Contains Overload List

10.1.17.1.6.2 MySqlParameterCollection.Contains Method

Gets a value indicating whether a MySqlParameter with the specified parameter name exists in the collection.

Syntax: Visual Basic

NotOverridable Overloads Public Function Contains( _
   ByVal name As String _
) As Boolean _
  Implements IDataParameterCollection.Contains

Syntax: C#

public bool Contains(
   string name
);

Parameters

Return Value

true if the collection contains the parameter; otherwise, false.

Implements

IDataParameterCollection.Contains

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.Contains Overload List

10.1.17.1.7 MySqlParameterCollection.CopyTo Method

Copies MySqlParameter objects from the MySqlParameterCollection to the specified array.

Syntax: Visual Basic

NotOverridable Public Sub CopyTo( _
   ByVal array As Array, _
   ByVal index As Integer _
) _
  Implements ICollection.CopyTo

Syntax: C#

public void CopyTo(
   Array array,
   int index
);

Parameters

Implements

ICollection.CopyTo

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.8 IndexOf Method

Gets the location of a MySqlParameter in the collection.

Overload List

Gets the location of a MySqlParameter in the collection.

Gets the location of the MySqlParameter in the collection with a specific parameter name.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.8.1 MySqlParameterCollection.IndexOf Method

Gets the location of a MySqlParameter in the collection.

Syntax: Visual Basic

NotOverridable Overloads Public Function IndexOf( _
   ByVal value As Object _
) As Integer _
  Implements IList.IndexOf

Syntax: C#

public int IndexOf(
   object value
);

Parameters

Return Value

The zero-based location of the MySqlParameter in the collection.

Implements

IList.IndexOf

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.IndexOf Overload List

10.1.17.1.8.2 MySqlParameterCollection.IndexOf Method

Gets the location of the MySqlParameter in the collection with a specific parameter name.

Syntax: Visual Basic

NotOverridable Overloads Public Function IndexOf( _
   ByVal parameterName As String _
) As Integer _
  Implements IDataParameterCollection.IndexOf

Syntax: C#

public int IndexOf(
   string parameterName
);

Parameters

Return Value

The zero-based location of the MySqlParameter in the collection.

Implements

IDataParameterCollection.IndexOf

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.IndexOf Overload List

10.1.17.1.9 MySqlParameterCollection.Insert Method

Inserts a MySqlParameter into the collection at the specified index.

Syntax: Visual Basic

NotOverridable Public Sub Insert( _
   ByVal index As Integer, _
   ByVal value As Object _
) _
  Implements IList.Insert

Syntax: C#

public void Insert(
   int index,
   object value
);

Parameters

Implements

IList.Insert

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.10 MySqlParameterCollection.Remove Method

Removes the specified MySqlParameter from the collection.

Syntax: Visual Basic

NotOverridable Public Sub Remove( _
   ByVal value As Object _
) _
  Implements IList.Remove

Syntax: C#

public void Remove(
   object value
);

Parameters

  • value:

Implements

IList.Remove

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.11 RemoveAt Method

Removes the specified MySqlParameter from the collection.

Overload List

Removes the specified MySqlParameter from the collection using a specific index.

Removes the specified MySqlParameter from the collection using the parameter name.

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace

10.1.17.1.11.1 MySqlParameterCollection.RemoveAt Method

Removes the specified MySqlParameter from the collection using a specific index.

Syntax: Visual Basic

NotOverridable Overloads Public Sub RemoveAt( _
   ByVal index As Integer _
) _
  Implements IList.RemoveAt

Syntax: C#

public void RemoveAt(
   int index
);

Parameters

  • index: The zero-based index of the parameter.

Implements

IList.RemoveAt

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.RemoveAt Overload List

10.1.17.1.11.2 MySqlParameterCollection.RemoveAt Method

Removes the specified MySqlParameter from the collection using the parameter name.

Syntax: Visual Basic

NotOverridable Overloads Public Sub RemoveAt( _
   ByVal name As String _
) _
  Implements IDataParameterCollection.RemoveAt

Syntax: C#

public void RemoveAt(
   string name
);

Parameters

Implements

IDataParameterCollection.RemoveAt

See Also

MySqlParameterCollection Class, MySql.Data.MySqlClient Namespace, MySqlParameterCollection.RemoveAt Overload List

10.1.18 MySqlRowUpdatedEventArgs Class

Provides data for the RowUpdated event. This class cannot be inherited.

For a list of all members of this type, see MySqlRowUpdatedEventArgs Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlRowUpdatedEventArgs_
  Inherits RowUpdatedEventArgs

Syntax: C#

public sealed class MySqlRowUpdatedEventArgs : RowUpdatedEventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlRowUpdatedEventArgs Members, MySql.Data.MySqlClient Namespace

10.1.18.1 MySqlRowUpdatedEventArgs Members

MySqlRowUpdatedEventArgs overview

Public Instance Constructors

MySqlRowUpdatedEventArgs ConstructorInitializes a new instance of the MySqlRowUpdatedEventArgs class.

Public Instance Properties

CommandOverloaded. Gets or sets the MySqlCommand executed when Update is called.
Errors (inherited from RowUpdatedEventArgs)Gets any errors generated by the .NET Framework data provider when the Commandwas executed.
RecordsAffected (inherited from RowUpdatedEventArgs)Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
Row (inherited from RowUpdatedEventArgs)Gets the DataRowsent through an Update.
RowCount (inherited from RowUpdatedEventArgs)Gets the number of rows processed in a batch of updated records.
StatementType (inherited from RowUpdatedEventArgs)Gets the type of SQL statement executed.
Status (inherited from RowUpdatedEventArgs)Gets the UpdateStatus of the Commandproperty.
TableMapping (inherited from RowUpdatedEventArgs)Gets the DataTableMappingsent through an Update.

Public Instance Methods

CopyToRows (inherited from RowUpdatedEventArgs)Overloaded. Copies references to the modified rows into the provided array.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlRowUpdatedEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.18.1.1 MySqlRowUpdatedEventArgs Constructor

Initializes a new instance of the MySqlRowUpdatedEventArgs class.

Syntax: Visual Basic

Public Sub New( _
   ByVal row As DataRow, _
   ByVal command As IDbCommand, _
   ByVal statementType As StatementType, _
   ByVal tableMapping As DataTableMapping _
)

Syntax: C#

public MySqlRowUpdatedEventArgs(
   DataRow row,
   IDbCommand command,
   StatementType statementType,
   DataTableMapping tableMapping
);

Parameters

  • row: The DataRowsent through an Update.

  • command: The IDbCommand executed when Update is called.

  • statementType: One of the StatementTypevalues that specifies the type of query executed.

  • tableMapping: The DataTableMapping sent through an Update.

See Also

MySqlRowUpdatedEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.18.1.2 Command Property

Gets or sets the MySqlCommand executed when Update is called.

Syntax: Visual Basic

Overloads Public ReadOnly Property Command As MySqlCommand

Syntax: C#

new public MySqlCommand Command {get;}

See Also

MySqlRowUpdatedEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.19 MySqlRowUpdatedEventHandler Delegate

Represents the method that will handle the RowUpdatedevent of a MySqlDataAdapter.

Syntax: Visual Basic

Public Delegate Sub MySqlRowUpdatedEventHandler( _
   ByVal sender As Object, _
   ByVal e As MySqlRowUpdatedEventArgs _
)

Syntax: C#

public delegate void MySqlRowUpdatedEventHandler(
   object sender,
   MySqlRowUpdatedEventArgs
);

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySql.Data.MySqlClient Namespace

10.1.20 MySqlRowUpdatingEventArgs Class

Provides data for the RowUpdating event. This class cannot be inherited.

For a list of all members of this type, see MySqlRowUpdatingEventArgs Members .

Syntax: Visual Basic

NotInheritable Public Class MySqlRowUpdatingEventArgs_
  Inherits RowUpdatingEventArgs

Syntax: C#

public sealed class MySqlRowUpdatingEventArgs : RowUpdatingEventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlRowUpdatingEventArgs Members, MySql.Data.MySqlClient Namespace

10.1.20.1 MySqlRowUpdatingEventArgs Members

MySqlRowUpdatingEventArgs overview

Public Instance Constructors

MySqlRowUpdatingEventArgs ConstructorInitializes a new instance of the MySqlRowUpdatingEventArgs class.

Public Instance Properties

CommandOverloaded. Gets or sets the MySqlCommand to execute when performing the Update.
Errors (inherited from RowUpdatingEventArgs)Gets any errors generated by the .NET Framework data provider when the Command executes.
Row (inherited from RowUpdatingEventArgs)Gets the DataRow that will be sent to the server as part of an insert, update, or delete operation.
StatementType (inherited from RowUpdatingEventArgs)Gets the type of SQL statement to execute.
Status (inherited from RowUpdatingEventArgs)Gets or sets the UpdateStatus of the Command property.
TableMapping (inherited from RowUpdatingEventArgs)Gets the DataTableMapping to send through the Update.

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlRowUpdatingEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.20.1.1 MySqlRowUpdatingEventArgs Constructor

Initializes a new instance of the MySqlRowUpdatingEventArgs class.

Syntax: Visual Basic

Public Sub New( _
   ByVal row As DataRow, _
   ByVal command As IDbCommand, _
   ByVal statementType As StatementType, _
   ByVal tableMapping As DataTableMapping _
)

Syntax: C#

public MySqlRowUpdatingEventArgs(
   DataRow row,
   IDbCommand command,
   StatementType statementType,
   DataTableMapping tableMapping
);

Parameters

  • row: The DataRowto Update.

  • command: The IDbCommandto execute during Update.

  • statementType: One of the StatementTypevalues that specifies the type of query executed.

  • tableMapping: The DataTableMappingsent through an Update.

See Also

MySqlRowUpdatingEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.20.1.2 Command Property

Gets or sets the MySqlCommand to execute when performing the Update.

Syntax: Visual Basic

Overloads Public Property Command As MySqlCommand

Syntax: C#

new public MySqlCommand Command {get; set;}

See Also

MySqlRowUpdatingEventArgs Class, MySql.Data.MySqlClient Namespace

10.1.21 MySqlRowUpdatingEventHandler Delegate

Represents the method that will handle the RowUpdatingevent of a MySqlDataAdapter.

Syntax: Visual Basic

Public Delegate Sub MySqlRowUpdatingEventHandler( _
   ByVal sender As Object, _
   ByVal e As MySqlRowUpdatingEventArgs _
)

Syntax: C#

public delegate void MySqlRowUpdatingEventHandler(
   object sender,
   MySqlRowUpdatingEventArgs
);

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySql.Data.MySqlClient Namespace

10.1.22 MySqlTransaction Class

For a list of all members of this type, see MySqlTransaction Members.

Syntax: Visual Basic

NotInheritable Public Class MySqlTransaction_
  Implements IDbTransaction, IDisposable

Syntax: C#

public sealed class MySqlTransaction : IDbTransaction, IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlTransaction Members, MySql.Data.MySqlClient Namespace

10.1.22.1 MySqlTransaction Members

MySqlTransaction overview

Public Instance Properties

ConnectionGets the MySqlConnection object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid.
IsolationLevelSpecifies the IsolationLevel for this transaction.

Public Instance Methods

Commit 
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
Rollback 
ToString (inherited from Object)Returns a String that represents the current Object.

See Also

MySqlTransaction Class, MySql.Data.MySqlClient Namespace

10.1.22.1.1 Connection Property

Gets the MySqlConnection object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid.

Syntax: Visual Basic

Public ReadOnly Property Connection As MySqlConnection

Syntax: C#

public MySqlConnection Connection {get;}

Property Value

The MySqlConnection object associated with this transaction.

Remarks

A single application may have multiple database connections, each with zero or more transactions. This property enables you to determine the connection object associated with a particular transaction created by BeginTransaction.

See Also

MySqlTransaction Class, MySql.Data.MySqlClient Namespace

10.1.22.1.2 IsolationLevel Property

Specifies the IsolationLevel for this transaction.

Syntax: Visual Basic

NotOverridable Public ReadOnly Property IsolationLevel As IsolationLevel _
  Implements IDbTransaction.IsolationLevel

Syntax: C#

public System.Data.IsolationLevel IsolationLevel {get;}

Property Value

The IsolationLevel for this transaction. The default is ReadCommitted.

Implements

IDbTransaction.IsolationLevel

Remarks

Parallel transactions are not supported. Therefore, the IsolationLevel applies to the entire transaction.

See Also

MySqlTransaction Class, MySql.Data.MySqlClient Namespace

10.1.22.1.3 MySqlTransaction.Commit Method

Syntax: Visual Basic

NotOverridable Public Sub Commit() _
  Implements IDbTransaction.Commit

Syntax: C#

public void Commit();

Implements

IDbTransaction.Commit

See Also

MySqlTransaction Class, MySql.Data.MySqlClient Namespace

10.1.22.1.4 MySqlTransaction.Rollback Method

Syntax: Visual Basic

NotOverridable Public Sub Rollback() _
  Implements IDbTransaction.Rollback

Syntax: C#

public void Rollback();

Implements

IDbTransaction.Rollback

See Also

MySqlTransaction Class, MySql.Data.MySqlClient Namespace

10.2 MySql.Data.Types Namespace

Namespace hierarchy

Classes

ClassDescription
MySqlConversionExceptionSummary description for MySqlConversionException.

Structures

StructureDescription
MySqlDateTimeSummary description for MySqlDateTime.

10.2.1 MySql.Data.TypesHierarchy

See Also

MySql.Data.Types Namespace

10.2.2 MySqlConversionException Class

Summary description for MySqlConversionException.

For a list of all members of this type, see MySqlConversionException Members.

Syntax: Visual Basic

Public Class MySqlConversionException _
  Inherits ApplicationException

Syntax: C#

public class MySqlConversionException : ApplicationException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.Types

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlConversionException Members, MySql.Data.Types Namespace

10.2.2.1 MySqlConversionException Members

MySqlConversionException overview

Public Instance Constructors

Public Instance Properties

Data (inherited from Exception)Gets a collection of key/value pairs that provide additional, user-defined information about the exception.
HelpLink (inherited from Exception)Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception)Gets the Exceptioninstance that caused the current exception.
Message (inherited from Exception)Gets a message that describes the current exception.
Source (inherited from Exception)Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception)Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception)Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception)When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from Exception)When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception)Gets the runtime type of the current instance.
ToString (inherited from Exception)Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception)Gets or sets HRESULT, a coded numeric value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

MySqlConversionException Class, MySql.Data.Types Namespace

10.2.2.1.1 MySqlConversionException Constructor

Syntax: Visual Basic

Public Sub New( _
   ByVal msg As String _
)

Syntax: C#

public MySqlConversionException(
   string msg
);

See Also

MySqlConversionException Class, MySql.Data.Types Namespace

10.2.3 MySqlDateTime Structure

Summary description for MySqlDateTime.

For a list of all members of this type, see MySqlDateTime Members.

Syntax: Visual Basic

Public Class MySqlDateTime_
  Implements IConvertible, IComparable

Syntax: C#

public class MySqlDateTime : IConvertible, IComparable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.Types

Assembly: MySql.Data (in MySql.Data.dll)

See Also

MySqlDateTime Members, MySql.Data.Types Namespace

10.2.3.1 MySqlDateTime Members

MySqlDateTime overview

Public Static (Shared) Type Conversions

Public Instance Properties

DayReturns the day portion of this datetime
HourReturns the hour portion of this datetime
IsNullReturns true if this datetime object has a null value
IsValidDateTimeIndicates if this object contains a value that can be represented as a DateTime
MillisecondReturns the millisecond portion of this datetime
MinuteReturns the minute portion of this datetime
MonthReturns the month portion of this datetime
SecondReturns the second portion of this datetime
ValueAsObjectReturns the value of this field as an object
YearReturns the year portion of this datetime

Public Instance Methods

Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetDateTimeReturns this value as a DateTime
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToStringReturns a MySQL-specific string representation of this value.

Protected Instance Fields

classTypeThe system type represented by this value.
dbTypeThe generic dbtype of this value.
isNullIs this value null.
mySqlDbTypeThe specific MySQL db type.
mySqlTypeNameThe MySQL-specific type name of this value.
objectValue 

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.1 MySqlDateTime Explicit MySqlDateTime to DateTime Conversion

Syntax: Visual Basic

MySqlDateTime.op_Explicit(val)

Syntax: C#

public static explicit operator DateTime(
   MySqlDateTime val
);

Parameters

  • val:

Return Value

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.2 Day Property

Returns the day portion of this DateTime type.

Syntax: Visual Basic

Public Property Day As Integer

Syntax: C#

public int Day {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.3 Hour Property

Returns the hour portion of this DateTime type.

Syntax: Visual Basic

Public Property Hour As Integer

Syntax: C#

public int Hour {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.4 IsNull Property

Syntax: Visual Basic

Public Property IsNull As Boolean

Syntax: C#

public bool IsNull {get; set;}

See Also

MySql.Data.Types Namespace

10.2.3.1.5 IsValidDateTime Property

Indicates if this object contains a value that can be represented as a DateTime type.

Syntax: Visual Basic

Public ReadOnly Property IsValidDateTime As Boolean

Syntax: C#

public bool IsValidDateTime {get;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.6 Millisecond Property

Returns the millisecond portion of this DateTime type.

Syntax: Visual Basic

Public Property Millisecond As Integer

Syntax: C#

public int Millisecond {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.7 Minute Property

Returns the minute portion of this DateTime type.

Syntax: Visual Basic

Public Property Minute As Integer

Syntax: C#

public int Minute {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.8 Month Property

Returns the month portion of this DateTime type.

Syntax: Visual Basic

Public Property Month As Integer

Syntax: C#

public int Month {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.9 Second Property

Returns the second portion of this DateTime type.

Syntax: Visual Basic

Public Property Second As Integer

Syntax: C#

public int Second {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.10 Year Property

Returns the year portion of this DateTime type.

Syntax: Visual Basic

Public Property Year As Integer

Syntax: C#

public int Year {get; set;}

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.11 MySqlDateTime.GetDateTime Method

Returns this value as a DateTime type.

Syntax: Visual Basic

Public Function GetDateTime() As Date

Syntax: C#

public DateTime GetDateTime();

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.2.3.1.12 MySqlDateTime.ToString Method

Returns a MySQL-specific string representation of this value.

Syntax: Visual Basic

Overrides Public Function ToString() As String

Syntax: C#

public override string ToString();

See Also

MySqlDateTime Structure, MySql.Data.Types Namespace

10.3 MySql.Data.MySqlClient.Memcached Namespace

Classes

ClassDescription
BinaryClientImplementation of Memcached binary client protocol.
ClientAn interface of the client Memcached protocol.
TextClientImplementation of the Memcached text client protocol

10.3.1 BinaryClient Class

For a list of all members of this type, see BinaryClient Members .

Syntax: Visual Basic

Public Class BinaryClient
 Inherits Client

Syntax: C#

public class BinaryClient : Client

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient.Memcached

Assembly: MySql.Data (in MySql.Data.dll)

See Also

BinaryClient Members, MySql.Data.MySqlClient.Memcached Namespace

10.3.1.1 BinaryClient Members

BinaryClient overview

Public Static Methods

GetInstanceInherited from Client

Protected Instance Properties

serverInherited from Client.
portInherited from Client.
streamInherited from Client.

Public Instance Methods

OpenInherited from Client.
CloseInherited from Client.
AddInherited from Client.
AppendInherited from Client.
CasInherited from Client.
Decrement>Inherited from Client.
DeleteInherited from Client.
FlushAllInherited from Client.
GetInherited from Client.
IncrementInherited from Client.
PrependInherited from Client.
ReplaceInherited from Client.
SetInherited from Client.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2 Client Class

For a list of all members of this type, see Client Members .

Syntax: Visual Basic

Public MustInherit Class Client

Syntax: C#

public abstract class Client

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient.Memcached

Assembly: MySql.Data (in MySql.Data.dll)

See Also

Client Members, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1 Client Members

Client overview

Public Static Methods

GetInstanceFactory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Client.Open

Protected Instance Properties

serverThe server DNS or IP address used by the connection.
portThe port used by the connection.
streamThe network stream used by the connecition.

Public Instance Methods

OpenOpens the client connection.
CloseCloses the client connection.
AddAdds a new key/value pair with the given TimeSpan expiration.
AppendAppends the data to the existing data for the associated key..
CasExecutes the Check-and-set Memcached operation.
Decrement>Decrements the value associated with a key by the given amount.
DeleteRemoves they pair key/value given the specified key.
FlushAllRemoves all entries from the storage, effectively invalidating the whole cache.
GetGet the key/value pair associated with a given key.
IncrementIncrements the value associated with a key by the given amount.
PrependPrepends the data to the existing data for the associated key.
ReplaceReplaces the value associated with the given key with another value.
SetSet the value of a given key.

Public Static Methods

GetInstanceFactory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Open.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.1 server Property

The server DNS or IP address used by the connection.

Syntax: Visual Basic

Protected server As String

Syntax: C#

protected string server

Property Value

The server DNS or IP address used by the connection.

Remarks

None

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.2 Port Property

The port used by the connection.

Syntax: Visual Basic

Protected port As UInteger

Syntax: C#

protected uint port

Property Value

The TCP port where the Innodb Memcached plugin will be listening for connections.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.3 stream

The network stream used by the connection.

Syntax: Visual Basic

Protected stream As Stream

Syntax: C#

protected Stream stream;

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.4 Client.Open Method

Syntax: Visual Basic

Public Overridable Sub Open

Syntax: C#

public virtual void Open();

Opens the client connection.

Remarks

A client object can be opened and closed many times during its life cycle.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.5 Client.Close Method

Syntax: Visual Basic

Public Overridable Sub Close

Syntax: C#

public virtual void Close();

Closes the client connection.

Remarks

A client object can be opened and closed many times during its life cycle.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.3.2.1.6 Client.Add Method

Syntax: Visual Basic

Public MustOverride Sub Add (
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Add(
 string key,
 Object data,
 TimeSpan expiration
);

Adds a new key/value pair with the given TimeSpan expiration.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to associate with the key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

10.3.2.1.7 Client.Append Method

Syntax: Visual Basic

Public MustOverride Sub Append (
 key As String,
 data As Object
)

Syntax: C#

public abstract void Append(
 string key,
 Object data
);

Appends the data to the existing data for the associated key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to append with the data associated with the key.

10.3.2.1.8 Client.Cas Method

Syntax: Visual Basic

Public MustOverride Sub Cas (
 key As String,
 data As Object,
 expiration As TimeSpan,
 casUnique As ULong
)

Syntax: C#

public abstract void Cas(
 string key,
 Object data,
 TimeSpan expiration,
 ulong casUnique
);

Executes the Check-and-set Memcached operation.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to use in the CAS.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

  • casUnique, The CAS unique value to use.

10.3.2.1.9 Client.Decrement Method

Syntax: Visual Basic

Public MustOverride Sub Decrement (
 key As String,
 amount As Integer
)

Syntax: C#

public abstract void Decrement(
 string key,
 int amount
);

Decrements the value associated with a key by the given amount.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to decrement.

  • amount, The amount to decrement the value.

10.3.2.1.10 Client.Delete Method

Syntax: Visual Basic

Public MustOverride Sub Delete (
 key As String
)

Syntax: C#

public abstract void Delete(
 string key
);

Removes they pair key/value given the specified key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to delete.

10.3.2.1.11 Client.FlushAll Method

Syntax: Visual Basic

Public MustOverride Sub FlushAll (
 delay As TimeSpan
)

Syntax: C#

public abstract void FlushAll(
 TimeSpan delay
);

Removes all entries from the storage, effectively invalidating the whole cache.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • TimeSpan, The interval after which the cache will be cleaned. Can be TimeSpan.Zero for immediately.

10.3.2.1.12 Client.Get Method

Syntax: Visual Basic

Public MustOverride Function Get (
 key As String
) As KeyValuePair(Of String, Object)

Syntax: C#

public abstract KeyValuePair string, Object> Get(
 string key
);

Get the key/value pair associated with a given key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for which to returm the key/value.

Return Value

The key/value associated with the key or a MemcachedException if it does not exists.

10.3.2.1.13 Client.Increment Method

Syntax: Visual Basic

Public MustOverride Sub Increment (
 key As String,
 amount As Integer
)

Syntax: C#

public abstract void Increment(
 string key,
 int amount
);

Increments the value associated with a key by the given amount.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to increment.

  • amount, The amount to increment the value.

10.3.2.1.14 Client.Prepend Method

Syntax: Visual Basic

Public MustOverride Sub Prepend (
 key As String,
 data As Object
)

Syntax: C#

public abstract void Prepend(
 string key,
 Object data
);

Prepends the data to the existing data for the associated key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to append with the data associated with the key.

10.3.2.1.15 Client.Replace Method

Syntax: Visual Basic

Public MustOverride Sub Replace (
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Replace(
 string key,
 Object data,
 TimeSpan expiration
);

Replaces the value associated with the given key with another value.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to replace the value associated with the key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

10.3.2.1.16 Client.Set Method

Syntax: Visual Basic

Public MustOverride Sub Set (
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Set(
 string key,
 Object data,
 TimeSpan expiration
);

Set the value of a given key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to associate with the given key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

10.3.2.1.17 Client.GetInstance Method

Syntax: Visual Basic

Public Shared Function GetInstance (
 server As String,
 port As UInteger,
 flags As MemcachedFlags
) As Client

Syntax: C#

public static Client GetInstance(
 string server,
 uint port,
 MemcachedFlags flags
);

Factory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Open().

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • server, The Memcached server DNS or IP address.

  • port, The port for the Memcached server.

  • flags, A set of flags indicating characteristics requested.

Return Value

An instance of a client connection ready to be used.

10.3.3 TextClient Class

For a list of all members of this type, see TextClient Members .

Syntax: Visual Basic

Public Class TextClient
 Inherits Client

Syntax: C#

public class TextClient : Client

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient.Memcached

Assembly: MySql.Data (in MySql.Data.dll)

See Also

TextClient Members, MySql.Data.MySqlClient.Memcached Namespace

10.3.3.1 TextClient Members

TextClient overview

Public Static Methods

GetInstanceInherited from Client

Protected Instance Properties

serverInherited from Client.
portInherited from Client.
streamInherited from Client.

Public Instance Methods

OpenInherited from Client.
CloseInherited from Client.
AddInherited from Client.
AppendInherited from Client.
CasInherited from Client.
Decrement>Inherited from Client.
DeleteInherited from Client.
FlushAllInherited from Client.
GetInherited from Client.
IncrementInherited from Client.
PrependInherited from Client.
ReplaceInherited from Client.
SetInherited from Client.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

10.4 MySql.Data.MySqlClient.Replication Namespace

This section of the manual contains the API reference for Replication and Load balancing components.

Classes

ClassDescription
ReplicationManagerManager for Replication and Load Balancing features.
ReplicationRoundRobinServerGroupClass that implements Round Robing Load Balancing technique.
ReplicationServerRepresents a server in Replication environment that contains information about
ReplicationServerGroupAbstract class used to implement a custom load balancing plugin

10.4.1 ReplicationManager Class

Members

Namespace: MySql.Data.MySqlClient.Replication

Assembly: MySql.Data (in MySql.Data.dll)

Syntax C#

public static class ReplicationManager
      

Syntax Visual Basic

Public NotInheritable Class ReplicationManager
      

Syntax Visual C++

public ref class ReplicationManager abstract sealed
      

See Also

ReplicationManager Members MySql.Data.MySqlClient.Replication Namespace

10.4.1.1 ReplicationManager Members

The ReplicationManager type exposes the following members.

Public Static Methods

NameDescription
AddGroup(String, Int32)Adds a Default Server Group to the list
AddGroup(String, String, Int32)Adds a Server Group to the list
GetGroupGets a Server Group by name
GetNewConnectionAssigns a new server driver to the connection object
GetServerGets the next server from a replication group
IsReplicationGroupValidates if the replication group name exists

Public Static Properties

NameDescription
GroupsReturns Replication Server Group List

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.1 AddGroup Method

Overload List

See Also

ReplicationManager Class ReplicationManager Members MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.1.1 ReplicationManager.AddGroup Method (String, Int32)

Adds a Default Server Group to the list

Syntax C#

public static ReplicationServerGroup AddGroup(
  string name,
  int retryTime
)
            

Syntax Visual Basic

Public Shared Function AddGroup ( _
  name As String, _
  retryTime As Integer _
) As ReplicationServerGroup
            

Syntax Visual C++

public:
static ReplicationServerGroup^ AddGroup(
  String^ name,
  int retryTime
)
            

Parameters

name

Type: System.String

Group name

retryTime

Type: System.Int32

Time between reconnections for failed servers

Return Value

A ReplicationServerGroup object

See Also

ReplicationManager Class AddGroup Overload MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.1.2 ReplicationManager.AddGroup Method (String, String, Int32)

Adds a Server Group to the list

Syntax C#

public static ReplicationServerGroup AddGroup(
  string name,
  string groupType,
  int retryTime
)
            

Syntax Visual Basic

Public Shared Function AddGroup ( _
  name As String, _
  groupType As String, _
  retryTime As Integer _
) As ReplicationServerGroup
            

Syntax Visual C++

public:
static ReplicationServerGroup^ AddGroup(
  String^ name,
  String^ groupType,
  int retryTime
)
            

Parameters

name

Type: System.String

Group name

groupType

Type: System.String

ServerGroup type reference

retryTime

Type: System.Int32

Time between reconnections for failed servers

Return Value

A ReplicationServerGroup object

See Also

ReplicationManager Class AddGroup Overload MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.2 ReplicationManager.GetGroup Method

Gets a Server Group by name

Syntax C#

public static ReplicationServerGroup GetGroup(
string groupName
)
          

Syntax Visual Basic

Public Shared Function GetGroup ( _
groupName As String _
) As ReplicationServerGroup
          

Syntax Visual C++

public:
static ReplicationServerGroup^ GetGroup(
String^ groupName
)
          

Parameters

groupName

Type: System.String

Group name

Return Value

A ReplicationServerGroup object

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.3 ReplicationManager.GetNewConnection Method

Assigns a new server driver to the connection object

Syntax C#

public static void GetNewConnection(
  string groupName,
  bool master,
  MySqlConnection connection
)
          

Syntax Visual Basic

Public Shared Sub GetNewConnection ( _
  groupName As String, _
  master As Boolean, _
  connection As MySqlConnection _
)
          

Syntax Visual C++

public:
static void GetNewConnection(
  String^ groupName,
  bool master,
  MySqlConnection^ connection
)
          

Parameters

groupName

Type: System.String

Group name

master

Type: System.Boolean

True if the server connection to assign must be a master

connection

Type: MySql.Data.MySqlClient.MySqlConnection

MySqlConnection object where the new driver will be assigned

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.4 ReplicationManager.GetServer Method

Gets the next server from a replication group

Syntax C#

public static ReplicationServer GetServer(
  string groupName,
  bool isMaster
)
          

Syntax Visual Basic

Public Shared Function GetServer ( _
  groupName As String, _
  isMaster As Boolean _
) As ReplicationServer
          

Syntax Visual C++

public:
static ReplicationServer^ GetServer(
  String^ groupName,
  bool isMaster
)
          

Parameters

groupName

Type: System.String

Group name

isMaster

Type: System.Boolean

True if the server to return must be a master

Return Value

A ReplicationServer object

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.5 ReplicationManager.IsReplicationGroup Method

Validates if the replication group name exists.

Syntax C#

public static bool IsReplicationGroup(
  string groupName
)
          

Syntax Visual Basic

Public Shared Function IsReplicationGroup ( _
  groupName As String _
) As Boolean
          

Syntax Visual C++

public:
static bool IsReplicationGroup(
  String^ groupName
)
          

Parameters

groupName

Type: System.String

Group name

Return Value

True if replication group name is found, otherwise false

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.1.1.6 ReplicationManager.Groups Property

Returns Replication Server Group List

Syntax C#

public static IList<ReplicationServerGroup> Groups { get; private set; }
          

Syntax Visual Basic

Public Shared Property Groups As IList(Of ReplicationServerGroup)
  Get
  Private Set
          

Syntax Visual C++

public:
static property IList<ReplicationServerGroup^>^ Groups {
  IList<ReplicationServerGroup^>^ get ();
  private: void set (IList<ReplicationServerGroup^>^ value);
}
          

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

10.4.2 ReplicationRoundRobinServerGroup Class

Members

Namespace: MySql.Data.MySqlClient.Replication

Assembly: MySql.Data (in MySql.Data.dll)

Syntax C#

public class ReplicationRoundRobinServerGroup : ReplicationServerGroup
      

Syntax Visual Basic

Public Class ReplicationRoundRobinServerGroup _
  Inherits ReplicationServerGroup
      

Syntax Visual C++

public ref class ReplicationRoundRobinServerGroup : public ReplicationServerGroup
      

See Also

ReplicationRoundRobinServerGroup Members MySql.Data.MySqlClient.Replication Namespace

10.4.2.1 ReplicationRoundRobinServerGroup Members

The ReplicationRoundRobinServerGroup type exposes the following members.

Public Instance Constructors

NameDescription
ReplicationRoundRobinServerGroupInitializes a new instance of the ReplicationRoundRobinServerGroup class

Public Instance Methods

NameDescription
AddServerAdds a server into the group (Inherited from ReplicationServerGroup)
EqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
GetServer(Boolean)Gets an available server based on Round Robin load balancing (Overrides ReplicationServerGroup.GetServer(Boolean).)
GetServer(String)Gets a server by name (Inherited from ReplicationServerGroup.)
GetTypeGets the Type of the current instance. (Inherited from Object.)
RemoveServerRemoves a server from group (Inherited from ReplicationServerGroup.)
ToStringReturns a string that represents the current object. (Inherited from Object.)

Public Instance Properties

NameDescription
Name(Inherited from ReplicationServerGroup.)
RetryTime(Inherited from ReplicationServerGroup.)
Servers(Inherited from ReplicationServerGroup.)

See Also

ReplicationRoundRobinServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.2.1.1 ReplicationRoundRobinServerGroup Constructor

Initializes a new instance of the ReplicationRoundRobinServerGroup class

Syntax C#

public ReplicationRoundRobinServerGroup(
  string name,
  int retryTime
)
          

Syntax Visual Basic

Public Sub New ( _
  name As String, _
  retryTime As Integer _
)
          

Syntax Visual C++

public:
ReplicationRoundRobinServerGroup(
  String^ name,
  int retryTime
)
          

Parameters

name

Type: System.String

Server name

retryTime

Type: System.Int32

Retry time between connections to failed connections

See Also

ReplicationRoundRobinServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.2.1.2 GetServer Method

Overload List

See Also

ReplicationRoundRobinServerGroup Class ReplicationRoundRobinServerGroup Members MySql.Data.MySqlClient.Replication Namespace

10.4.2.1.2.1 ReplicationRoundRobinServerGroup.GetServer Method (Boolean)

Gets an available server based on Round Robin load balancing (Overrides ReplicationServerGroup.GetServer(Boolean).)

Syntax C#

public override ReplicationServer GetServer(
  bool isMaster
)
            

Syntax Visual Basic

Public Overrides Function GetServer ( _
  isMaster As Boolean _
) As ReplicationServer
            

Syntax Visual C++

public:
virtual ReplicationServer^ GetServer(
  bool isMaster
) override
            

Parameters

isMaster

Type: System.Boolean

True if the server to return must be a master

Return Value

A ReplicationServer object

See Also

ReplicationRoundRobinServerGroup Class GetServer Overload MySql.Data.MySqlClient.Replication Namespace

10.4.3 ReplicationServer Class

Members

Namespace: MySql.Data.MySqlClient.Replication

Assembly: MySql.Data (in MySql.Data.dll)

Syntax C#

public class ReplicationServer
      

Syntax Visual Basic

Public Class ReplicationServer
      

Syntax Visual C++

public ref class ReplicationServer
      

See Also

ReplicationServer Members MySql.Data.MySqlClient.Replication Namespace

10.4.3.1 ReplicationServer Members

The ReplicationServer type exposes the following members.

Public Instance Constructors

NameDescription
ReplicationServerInitializes a new instance of the ReplicationServer class

Public Instance Methods

NameDescription
EqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
GetTypeGets the Type of the current instance. (Inherited from Object.)
ToStringReturns a string that represents the current object. (Inherited from Object.)

Public Instance Properties

NameDescription
ConnectionStringConnection string used to connect to the server
IsAvailableDefines if the server is available to be considered in load balancing
IsMasterDefines if the server is master (True) or slave
NameServer name

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.3.1.1 ReplicationServer Constructor

Initializes a new instance of the ReplicationServer class

Syntax C#

public ReplicationServer(
  string name,
  bool isMaster,
  string connectionString
)
          

Syntax Visual Basic

Public Sub New ( _
  name As String, _
  isMaster As Boolean, _
  connectionString As String _
)
          

Syntax Visual C++

public:
ReplicationServer(
  String^ name,
  bool isMaster,
  String^ connectionString
)
          

Parameters

name

Type: System.String

Server name

isMaster

Type: System.Boolean

Defines if the server is master (True) or slave

connectionString

Type: System.String

Connection string used to connect to the server

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.3.1.2 ReplicationServer.ConnectionString Property

Connection string used to connect to the server

Syntax C#

public string ConnectionString { get; private set; }
          

Syntax Visual Basic

Public Property ConnectionString As String
  Get
  Private Set
          

Syntax Visual C++

public:
property String^ ConnectionString {
  String^ get ();
  private: void set (String^ value);
}
          

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.3.1.3 ReplicationServer.IsAvailable Property

Defines if the server is available to be considered in load balancing

Syntax C#

public bool IsAvailable { get; set; }
          

Syntax Visual Basic

Public Property IsAvailable As Boolean
  Get
  Set
          

Syntax Visual C++

public:
property bool IsAvailable {
  bool get ();
  void set (bool value);
}
          

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.3.1.4 ReplicationServer.IsMaster Property

Defines if the server is master (True) or slave

Syntax C#

public bool IsMaster { get; private set; }
          

Syntax Visual Basic

Public Property IsMaster As Boolean
  Get
  Private Set
          

Syntax Visual C++

public:
property bool IsMaster {
  bool get ();
  private: void set (bool value);
}
          

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.3.1.5 ReplicationServer.Name Property

Server name

Syntax C#

public string Name { get; private set; }
          

Syntax Visual Basic

Public Property Name As String
  Get
  Private Set
          

Syntax Visual C++

public:
property String^ Name {
  String^ get ();
  private: void set (String^ value);
}
          

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

10.4.4 ReplicationServerGroup Class

Members

Base class used to implement load balancing features

Namespace: MySql.Data.MySqlClient.Replication

Assembly: MySql.Data (in MySql.Data.dll)

Syntax C#

public abstract class ReplicationServerGroup
      

Syntax Visual Basic

Public MustInherit Class ReplicationServerGroup
      

Syntax Visual C++

public ref class ReplicationServerGroup abstract
      

See Also

ReplicationServerGroup Members MySql.Data.MySqlClient.Replication Namespace

10.4.4.1 ReplicationServerGroup Members

The ReplicationServerGroup type exposes the following members.

Public Instance Constructors

NameDescription
ReplicationServerGroupInitializes a new instance of the ReplicationServerGroup class

Public Instance Methods

NameDescription
AddServerAdds a server into the group
EqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
GetServer(Boolean)Must be implemented. Defines the next server for a custom load balancing implementation.
GetServer(String)Gets a server by name.
GetTypeGets the Type of the current instance. (Inherited from Object.)
RemoveServerRemoves a server from group.
ToStringReturns a string that represents the current object. (Inherited from Object.)

Public Instance Properties

NameDescription
NameGroup name
RetryTimeRetry time between connections to failed servers
ServersServers list in the group

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.1 ReplicationServerGroup Constructor

Initializes a new instance of the ReplicationServerGroup class

Syntax C#

public ReplicationServerGroup(
  string name,
  int retryTime
)
          

Syntax Visual Basic

Public Sub New ( _
  name As String, _
  retryTime As Integer _
)
          

Syntax Visual C++

public:
ReplicationServerGroup(
  String^ name,
  int retryTime
)
          

Parameters

name

Type: System.String

Group name

retryTime

Type: System.Int32

Retry time between connections to failed servers

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.2 ReplicationServerGroup.AddServer Method

Adds a server into the group.

Syntax C#

public ReplicationServer AddServer(
  string name,
  bool isMaster,
  string connectionString
)
          

Syntax Visual Basic

Public Function AddServer ( _
  name As String, _
  isMaster As Boolean, _
  connectionString As String _
) As ReplicationServer
          

Syntax Visual C++

public:
ReplicationServer^ AddServer(
  String^ name,
  bool isMaster,
  String^ connectionString
)
          

Parameters

name

Type: System.String

Server name

isMaster

Type: System.Boolean

True if the server to add is master, False for slave server

connectionString

Type: System.String

Connection string used by this server

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.3 GetServer Method

Overload List

See Also

ReplicationServerGroup Class ReplicationServerGroup Members MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.3.1 ReplicationServerGroup.GetServer Method (Boolean)

Must be implemented. Defines the next server for a custom load balancing implementation.

Syntax C#

public abstract ReplicationServer GetServer(
  bool isMaster
)
            

Syntax Visual Basic

Public MustOverride Function GetServer ( _
  isMaster As Boolean _
) As ReplicationServer
            

Syntax Visual C++

public:
virtual ReplicationServer^ GetServer(
  bool isMaster
) abstract
            

Parameters

isMaster

Type: System.Boolean

Defines if the server to return is a master or any

Return Value

A ReplicationServer object

See Also

ReplicationServerGroup Class GetServer Overload MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.3.2 ReplicationServerGroup.GetServer Method (String)

Gets a server by name.

Syntax C#

public ReplicationServer GetServer(
  string name
)
            

Syntax Visual Basic

Public Function GetServer ( _
  name As String _
) As ReplicationServer
            

Syntax Visual C++

public:
ReplicationServer^ GetServer(
  String^ name
)
            

Parameters

name

Type: System.String

Server name

Return Value

A ReplicationServer object

See Also

ReplicationServerGroup Class GetServer Overload MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.4 ReplicationServerGroup.RemoveServer Method

Removes a server from group.

Syntax C#

public void RemoveServer(
  string name
)
          

Syntax Visual Basic

Public Sub RemoveServer ( _
  name As String _
)
          

Syntax Visual C++

public:
void RemoveServer(
  String^ name
)
          

Parameters

name

Type: System.String

Server name

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.5 ReplicationServerGroup.Name Property

Group name.

Syntax C#

public string Name { get; private set; }
          

Syntax Visual Basic

Public Property Name As String
  Get
  Private Set
          

Syntax Visual C++

public:
property String^ Name {
  String^ get ();
  private: void set (String^ value);
}
          

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.6 ReplicationServerGroup.RetryTime Property

Retry time between connections to failed servers.

Syntax C#

public int RetryTime { get; private set; }
          

Syntax Visual Basic

Public Property RetryTime As Integer
  Get
  Private Set
          

Syntax Visual C++

public:
property int RetryTime {
  int get ();
  private: void set (int value);
}
          

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

10.4.4.1.7 ReplicationServerGroup.Servers Property

Servers list in the group.

Syntax C#

public IList<ReplicationServer> Servers { get; private set; }
          

Syntax Visual Basic

Public Property Servers As IList(Of ReplicationServer)
  Get
  Private Set
          

Syntax Visual C++

public:
property IList<ReplicationServer^>^ Servers {
  IList<ReplicationServer^>^ get ();
  private: void set (IList<ReplicationServer^>^ value);
}
          

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace