UserId Property (MySqlConnection)
Gets or sets the name of the user to connect.
|
|---|
'Declaration
Public Property UserId As String |
|
|---|
public string UserId {get; set;} |
Property Value
The name of the user to connect.
The following example creates a
MySqlConnection and displays the user name.
|
|---|
public void CreateMySqlConnection()
{
string myConnString =
"User Id=root;Host=localhost;Database=Test;";
MySqlConnection mySqlConnection = new MySqlConnection(myConnString);
mySqlConnection.Open();
MessageBox.Show("User: " + mySqlConnection.UserId);
mySqlConnection.Close();
} |
|
|---|
Public Sub CreateMySqlConnection()
Dim myConnString As String = _
"User Id=root;Host=localhost;Database=Test;"
Dim mySqlConnection As New MySqlConnection(myConnString)
mySqlConnection.Open()
MessageBox.Show("User: " + mySqlConnection.UserId)
mySqlConnection.Close()
End Sub |