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 a few other things, but I received errors when I included the commented out information.
public static MySqlConnection getconnection()
{
string connectionstring = "serve=r127.0.0.1; uid = root;" + "pwd = databasses; database = group1;"
MySqlConnection connection = new MySqlConnection(connectionstring);
return connection;
}
Commented out information:
//string connectionstring = "Data Source=localhost\\MySql;Initial Catalog = group1; Integrated Security=True";
and
//conection.Open();
Is there a way for me to check if my connection is made? I am able to run it and display a blank form, but I'm worried it's wrong.