MySqlConnection class
MySqlConnection represents a connection to a MySQL database.
public sealed class MySqlConnection : DbConnection, ICloneable
Public Members
| name | description |
|---|---|
| MySqlConnection() | The default constructor. |
| MySqlConnection(…) | |
| override CanCreateBatch { get; } | |
| override ConnectionString { get; set; } | |
| override ConnectionTimeout { get; } | Gets the time (in seconds) to wait while trying to establish a connection before terminating the attempt and generating an error. This value is controlled by ConnectionTimeout, which defaults to 15 seconds. |
| override Database { get; } | |
| override DataSource { get; } | |
| ProvideClientCertificatesCallback { get; set; } | Gets or sets the delegate used to provide client certificates for connecting to a server. |
| ProvidePasswordCallback { get; set; } | Gets or sets the delegate used to generate a password for new database connections. |
| RemoteCertificateValidationCallback { get; set; } | Gets or sets the delegate used to verify that the server’s certificate is valid. |
| ServerThread { get; } | The connection ID from MySQL Server. |
| override ServerVersion { get; } | |
| override State { get; } | |
| event InfoMessage | |
| BeginTransaction() | Begins a database transaction. |
| BeginTransaction(…) | Begins a database transaction. (2 methods) |
| BeginTransactionAsync(…) | Begins a database transaction asynchronously. (3 methods) |
| override ChangeDatabase(…) | |
| override ChangeDatabaseAsync(…) | |
| Clone() | |
| CloneWith(…) | Returns an unopened copy of this connection with a new connection string. If the Password in connectionString is not set, the password from this connection will be used. This allows creating a new connection with the same security information while changing other options, such as database or pooling. |
| override Close() | |
| override CloseAsync() | |
| CreateBatch() | Creates a MySqlBatch object for executing batched commands. |
| CreateCommand() | |
| override DisposeAsync() | |
| override EnlistTransaction(…) | |
| override GetSchema() | Returns schema information for the data source of this MySqlConnection. |
| override GetSchema(…) | Returns schema information for the data source of this MySqlConnection. (2 methods) |
| override GetSchemaAsync(…) | Asynchronously returns schema information for the data source of this MySqlConnection. (3 methods) |
| override Open() | |
| override OpenAsync(…) | |
| Ping() | |
| PingAsync(…) | |
| ResetConnectionAsync(…) | Resets the session state of the current open connection; this clears temporary tables and user-defined variables. |
| static ClearAllPools() | Clears all connection pools. |
| static ClearAllPoolsAsync(…) | Asynchronously clears all connection pools. |
| static ClearPool(…) | Clears the connection pool that connection belongs to. |
| static ClearPoolAsync(…) | Asynchronously clears the connection pool that connection belongs to. |
Protected Members
| name | description |
|---|---|
| override DbProviderFactory { get; } | |
| override BeginDbTransaction(…) | Begins a database transaction. |
| override BeginDbTransactionAsync(…) | Begins a database transaction asynchronously. |
| override CreateDbBatch() | |
| override CreateDbCommand() | |
| override Dispose(…) |
See Also
- namespace MySqlConnector
- assembly MySqlConnector