Represents an open connection to a MySQL database.
For a list of all members of this type, see MySqlConnection members.
Devart.Common.DbConnectionBase
Devart.Data.MySql.MySqlConnection
[Visual Basic]
Public Class MySqlConnection
Inherits DbConnectionBase
Implements IComponent , IDbConnection , ICloneable , IDisposable [C#]
public class MySqlConnection : DbConnectionBase, IComponent , IDbConnection , ICloneable , IDisposable A MySqlConnection object represents a unique connection to the MySQL database. Use it in conjunction with MySqlCommand, MySqlDataReader, MySqlDataAdapter or other components for convenient interoperation with MySQL database.
When you create an instance of MySqlConnection, all properties are set to their initial values. For a list of these values, see the #ctor constructor.
If the MySqlConnection goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling Close.
A single MySqlConnection can be used by many MySqlCommand objects on the assumption that all operations will be done consecutively. In other words, you can not execute a SQL statement while an asynchronous operation is in progress.
This class supports cross-form data binding with the InterForm Technology.
The following example creates a MySqlCommand and a MySqlConnection. The MySqlConnection is opened and set as the Connection property. The example then calls ExecuteNonQuery method, and closes the connection. To accomplish this, the ExecuteNonQuery is passed a connection string and a query string that is SQL INSERT statement.
[C#]
public void InsertRow(string myConnectionString) |
[Visual Basic]
Public Sub InsertRow(myConnectionString As String) |
MySqlConnection Members | Devart.Data.MySql Namespace | MySqlDataAdapter Class | MySqlCommand Class
© 2002 - 2008 Devart. All Rights Reserved.