I'm trying to get a connection to my local MySQL database, I'm not sure what all the parameters are. Hopefully someone can help.
My code:
string connetionString = "Server = 127.0.0.1; Database = name of database; User Id = root, Password = password of database";
SqlConnection cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "titel", MessageBoxButtons.OK);
MessageBox.Show("Can not open connection ! ");
}
Thanks