Spec-Zone .ru
спецификации, руководства, описания, API

22.2.9.2. MySql.Data.Types Namespace

Namespace hierarchy

Classes

Class Description
MySqlConversionException Summary description for MySqlConversionException.
MySqlDateTime Summary description for MySqlDateTime.
MySqlValue

22.2.9.2.1. MySql.Data.TypesHierarchy

See Also

MySql.Data.Types Namespace

22.2.9.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

22.2.9.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 timethe 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 withinformation 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 isassigned 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 garbagecollection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

MySqlConversionException Class, MySql.Data.Types Namespace

22.2.9.2.2.1.1. MySqlConversionException Constructor

Syntax: Visual Basic

Public Sub New( _   ByVal msg As String _)

Syntax: C#

public MySqlConversionException(stringmsg);

See Also

MySqlConversionException Class, MySql.Data.Types Namespace

22.2.9.2.3. MySqlDateTime Class

Summary description for MySqlDateTime.

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

Syntax: Visual Basic

Public Class MySqlDateTime_  Inherits MySqlValue_  Implements IConvertible, IComparable

Syntax: C#

public class MySqlDateTime : MySqlValue, 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

22.2.9.2.3.1. MySqlDateTime Members

MySqlDateTime overview

Public Static (Shared) Type Conversions

Public Instance Properties

Day Returns the day portion of this datetime
Hour Returns the hour portion of this datetime
IsNull (inherited from MySqlValue)
IsValidDateTime Indicates if this object contains a value that can be represented as a DateTime
Minute Returns the minute portion of this datetime
Month Returns the month portion of this datetime
Second Returns the second portion of this datetime
Millisecond Returns the millisecond portion of this datetime
ValueAsObject(inherited from MySqlValue) Returns the value of this field as an object
Year Returns the year portion of this datetime

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GetDateTime Returns 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 likea hash table.
GetType (inherited from Object) Gets the Type of the current instance.
ToString Returns a MySQL-specific string representation of this value

Protected Instance Fields

classType (inherited from MySqlValue) The system type represented by this value
dbType (inherited from MySqlValue) The generic dbtype of this value
isNull (inherited from MySqlValue) Is this value null
mySqlDbType (inherited from MySqlValue) The specific MySQL db type
mySqlTypeName (inherited from MySqlValue) The MySQL-specific typename of this value
objectValue(inherited from MySqlValue)

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 garbagecollection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.1. MySqlDateTime Explicit MySqlDateTime toDateTime Conversion

Syntax: Visual Basic

MySqlDateTime.op_Explicit(val)

Syntax: C#

public static explicit operator DateTime(MySqlDateTimeval);

Parameters

  • val:

Return Value

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.2. Day Property

Returns the day portion of this datetime

Syntax: Visual Basic

Public Property Day As Integer

Syntax: C#

public int Day {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.3. Hour Property

Returns the hour portion of this datetime

Syntax: Visual Basic

Public Property Hour As Integer

Syntax: C#

public int Hour {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4. IsNull Property

Syntax: Visual Basic

Public Property IsNull As Boolean

Syntax: C#

public bool IsNull {get; set;}

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1. MySqlValue Class

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

Syntax: Visual Basic

MustInherit Public Class MySqlValue

Syntax: C#

public abstract class MySqlValue

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

MySqlValue Members, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1. MySqlValue Members

MySqlValue overview

Protected Static (Shared) Fields

Public Instance Constructors

MySqlValue Constructor Initializes a new instance of the MySqlValueclass.

Public Instance Properties

IsNull
ValueAsObject Returns the value of this field as an object

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 datastructures like a hash table.
GetType (inherited from Object) Gets the Type of the current instance.
ToString Returns a string representation of this value

Protected Instance Fields

classType The system type represented by this value
dbType The generic dbtype of this value
isNull Is this value null
mySqlDbType The specific MySQL db type
mySqlTypeName The MySQL-specific typename 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 bygarbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.1. MySqlValue.numberFormat Field

Syntax: Visual Basic

Protected Shared numberFormat As NumberFormatInfo

Syntax: C#

protected static NumberFormatInfo numberFormat;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.2. MySqlValue Constructor

Initializes a new instance of the MySqlValue class.

Syntax: Visual Basic

Public Sub New()

Syntax: C#

public MySqlValue();

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.3. ValueAsObject Property

Returns the value of this field as an object

Syntax: Visual Basic

Public ReadOnly Property ValueAsObject As Object

Syntax: C#

public object ValueAsObject {get;}

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.4. MySqlValue.ToString Method

Returns a string representation of this value

Syntax: Visual Basic

Overrides Public Function ToString() As String

Syntax: C#

public override string ToString();

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.5. MySqlValue.classType Field

The system type represented by this value

Syntax: Visual Basic

Protected classType As Type

Syntax: C#

protected Type classType;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.6. MySqlValue.dbType Field

The generic dbtype of this value

Syntax: Visual Basic

Protected dbType As DbType

Syntax: C#

protected DbType dbType;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.7. MySqlValue.mySqlDbType Field

The specific MySQL db type

Syntax: Visual Basic

Protected mySqlDbType As MySqlDbType

Syntax: C#

protected MySqlDbType mySqlDbType;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.8. MySqlValue.mySqlTypeName Field

The MySQL-specific typename of this value

Syntax: Visual Basic

Protected mySqlTypeName As String

Syntax: C#

protected string mySqlTypeName;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.4.1.1.9. MySqlValue.objectValue Field

Syntax: Visual Basic

Protected objectValue As Object

Syntax: C#

protected object objectValue;

See Also

MySqlValue Class, MySql.Data.Types Namespace

22.2.9.2.3.1.5. IsValidDateTime Property

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

Syntax: Visual Basic

Public ReadOnly Property IsValidDateTime As Boolean

Syntax: C#

public bool IsValidDateTime {get;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.6. Millisecond Property

Returns the millisecond portion of this datetime

Syntax: Visual Basic

Public Property Millisecond As Integer

Syntax: C#

public int Millisecond {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.7. Minute Property

Returns the minute portion of this datetime

Syntax: Visual Basic

Public Property Minute As Integer

Syntax: C#

public int Minute {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.8. Month Property

Returns the month portion of this datetime

Syntax: Visual Basic

Public Property Month As Integer

Syntax: C#

public int Month {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.9. Second Property

Returns the second portion of this datetime

Syntax: Visual Basic

Public Property Second As Integer

Syntax: C#

public int Second {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.10. Year Property

Returns the year portion of this datetime

Syntax: Visual Basic

Public Property Year As Integer

Syntax: C#

public int Year {get; set;}

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.2.3.1.11. MySqlDateTime.GetDateTime Method

Returns this value as a DateTime

Syntax: Visual Basic

Public Function GetDateTime() As Date

Syntax: C#

public DateTime GetDateTime();

See Also

MySqlDateTime Class, MySql.Data.Types Namespace

22.2.9.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 Class, MySql.Data.Types Namespace

22.2.9.2.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

22.2.9.2.3.2.1. Client Members

Client overview

Public Static Methods

GetInstance Factory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitelyopened see method Client.Open

Protected Instance Properties

server The server DNS or IP address used by the connection.
port The port used by the connection.
stream The network stream used by the connecition.

Public Instance Methods

Open Opens the client connection.
Close Closes the client connection.
Add Adds a new key/value pair with the given TimeSpan expiration.
Append Appends the data to the existing data for the associated key..
Cas Executes the Check-and-set Memcached operation.
Decrement> Decrements the value associated with a key by the given amount.
Delete Removes they pair key/value given the specified key.
FlushAll Removes all entries from the storage, effectively invalidating the wholecache.
Get Get the key/value pair associated with a given key.
Increment Increments the value associated with a key by the given amount.
Prepend Prepends the data to the existing data for the associated key.
Replace Replaces the value associated with the given key with another value.
Set Set the value of a given key.

Public Static Methods

GetInstance Factory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitelyopened see method Open.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

22.2.9.2.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

22.2.9.2.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

22.2.9.2.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

22.2.9.2.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

22.2.9.2.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

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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.

22.2.9.2.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 characterestics requested.

Return Value

An instance of a client connection ready to be used.

22.2.9.2.3.3. 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

22.2.9.2.3.3.1. BinaryClient Members

BinaryClient overview

Public Static Methods

GetInstance Inherited from Client

Protected Instance Properties

server Inherited from Client.
port Inherited from Client.
stream Inherited from Client.

Public Instance Methods

Open Inherited from Client.
Close Inherited from Client.
Add Inherited from Client.
Append Inherited from Client.
Cas Inherited from Client.
Decrement> Inherited from Client.
Delete Inherited from Client.
FlushAll Inherited from Client.
Get Inherited from Client.
Increment Inherited from Client.
Prepend Inherited from Client.
Replace Inherited from Client.
Set Inherited from Client.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

22.2.9.2.3.4. 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

22.2.9.2.3.4.1. TextClient Members

TextClient overview

Public Static Methods

GetInstance Inherited from Client

Protected Instance Properties

server Inherited from Client.
port Inherited from Client.
stream Inherited from Client.

Public Instance Methods

Open Inherited from Client.
Close Inherited from Client.
Add Inherited from Client.
Append Inherited from Client.
Cas Inherited from Client.
Decrement> Inherited from Client.
Delete Inherited from Client.
FlushAll Inherited from Client.
Get Inherited from Client.
Increment Inherited from Client.
Prepend Inherited from Client.
Replace Inherited from Client.
Set Inherited from Client.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

22.2.9.2.3.5. MySql.Data.MySqlClient.Replication Namespace

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

Classes

Class Description
ReplicationManager Manager for Replication and Load Balancing features.
ReplicationRoundRobinServerGroup Class that implements Round Robing Load Balancing technique.
ReplicationServer Represents a server in Replication environment that contains informationabout
ReplicationServerGroup Abstract class used to implement a custom load balancing plugin
22.2.9.2.3.5.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

22.2.9.2.3.5.1.1. ReplicationManager Members

The ReplicationManager type exposes the following members.

Public Static Methods

Name Description
AddGroup(String, Int32) Adds a Default Server Group to the list
AddGroup(String,String, Int32) Adds a Server Group to the list
GetGroup Gets a Server Group by name
GetNewConnection Assigns a new server driver to the connection object
GetServer Gets the next server from a replication group
IsReplicationGroup Validates if the replication group name exists

Public Static Properties

Name Description
Groups Returns Replication Server Group List

See Also

ReplicationManager Class MySql.Data.MySqlClient.Replication Namespace

22.2.9.2.3.5.1.1.1. AddGroup Method

Overload List

See Also

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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.2.1. ReplicationRoundRobinServerGroup Members

The ReplicationRoundRobinServerGroup type exposes the following members.

Public Instance Constructors

Name Description
ReplicationRoundRobinServerGroup Initializes a new instance of the ReplicationRoundRobinServerGroupclass

Public Instance Methods

Name Description
AddServer Adds a server into the group (Inherited from ReplicationServerGroup)
Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCode Serves 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.)
GetType Gets the Type of the current instance. (Inherited from Object.)
RemoveServer Removes a server from group (Inherited from ReplicationServerGroup.)
ToString Returns a string that represents the current object. (Inherited fromObject.)

Public Instance Properties

Name Description
Name (Inherited from ReplicationServerGroup.)
RetryTime (Inherited from ReplicationServerGroup.)
Servers (Inherited fromReplicationServerGroup.)

See Also

ReplicationRoundRobinServerGroup Class MySql.Data.MySqlClient.Replication Namespace

22.2.9.2.3.5.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

22.2.9.2.3.5.2.1.2. GetServer Method

Overload List

See Also

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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.3.1. ReplicationServer Members

The ReplicationServer type exposes the following members.

Public Instance Constructors

Name Description
ReplicationServer Initializes a new instance of the ReplicationServerclass

Public Instance Methods

Name Description
Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetType Gets the Type of the current instance. (Inherited from Object.)
ToString Returns a string that represents the current object. (Inherited fromObject.)

Public Instance Properties

Name Description
ConnectionString Connection string used to connect to the server
IsAvailable Defines if the server is available to be considered in load balancing
IsMaster Defines if the server is master (True) or slave
Name Server name

See Also

ReplicationServer Class MySql.Data.MySqlClient.Replication Namespace

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.4.1. ReplicationServerGroup Members

The ReplicationServerGroup type exposes the following members.

Public Instance Constructors

Name Description
ReplicationServerGroup Initializes a new instance of the ReplicationServerGroupclass

Public Instance Methods

Name Description
AddServer Adds a server into the group
Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
GetHashCode Serves 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.
GetType Gets the Type of the current instance. (Inherited from Object.)
RemoveServer Removes a server from group.
ToString Returns a string that represents the current object. (Inherited fromObject.)

Public Instance Properties

Name Description
Name Group name
RetryTime Retry time between connections to failed servers
Servers Servers list in the group

See Also

ReplicationServerGroup Class MySql.Data.MySqlClient.Replication Namespace

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.4.1.3. GetServer Method

Overload List

See Also

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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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

22.2.9.2.3.5.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