MySqlConnection cnn = new MySqlConnection();
cnn.ConnectionString += @"DataBase=" + dbhosts + ";";
cnn.ConnectionString += @"User=" + usuario + ";";
cnn.ConnectionString += @"Password=" + senha + ";";
cnn.ConnectionString += @"DataSource=" + hosts[count] + ";";
if ( cnn is able to open )
{
cnn.Open();
}
else
{
MessageBox.Show("HOST:" + hosts[count].ToString() + "DATABASE:" + dbhosts.ToString() + "\n\r" + "Recheck connection");
}
before open i need to know if it right connection How?
How can i check my connection string is able to open
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted May 30, 2012, 5:45 AM EDT
Saqi60 reputationPosted May 30, 2012, 5:58 AM EDT