I\'m trying to write data access code to connect MySQL to visual studio. I have this code so far, but I do not know if it\'s correct. I\'m using my books and have commented out
From the MySQL website here is their example code on how to use C# to connect to a MySQL database:
MySql.Data.MySqlClient.MySqlConnection conn;
string myConnectionString;
myConnectionString = "server=127.0.0.1;uid=root;" +
"pwd=12345;database=test;";
try
{
conn = new MySql.Data.MySqlClient.MySqlConnection();
conn.ConnectionString = myConnectionString;
conn.Open();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show(ex.Message);
}