How can i check my connection string is able to open
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?