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 myConnection = new MySqlConnection(myConnString);
myConnection.Open();
MessageBox.Show("ServerVersion: " + myConnection.ServerVersion
+ "\nState: " + myConnection.State.ToString());
myConnection.Close();
}
Public Sub CreateMySqlConnection(myConnString As String)
Dim myConnection As New MySqlConnection(myConnString)
myConnection.Open()
MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _
+ ControlChars.Cr + "State: " + myConnection.State.ToString())
myConnection.Close()
End Sub