Open Method (MySqlConnection)
Opens a MySQL connection with the property settings specified by the
ConnectionString.
The following example creates a
MySqlConnection, opens it, displays some of its properties, and then closes the connection.
|
|---|
public void CreateMySqlConnection(string myConnString)
{
MySqlConnection mySqlConnection = new MySqlConnection(myConnString);
mySqlConnection.Open();
MessageBox.Show("ServerVersion: " + mySqlConnection.ServerVersion
+ "\nState: " + mySqlConnection.State.ToString());
mySqlConnection.Close();
} |
|
|---|
Public Sub CreateMySqlConnection(myConnString As String)
Dim mySqlConnection As New MySqlConnection(myConnString)
mySqlConnection.Open()
MessageBox.Show("ServerVersion: " + mySqlConnection.ServerVersion _
+ ControlChars.Cr + "State: " + mySqlConnection.State.ToString())
mySqlConnection.Close()
End Sub |