Hey
I have the following code
private void buttonInicio_Click(object sender, EventArgs e)
{
MySql.Data.MySqlClient.MySqlConnection conn;
String constring = "server=localhost;database=bd;uid=user;password=pass;";
try
{
conn = new MySql.Data.MySqlClient.MySqlConnection(constring);
string query = "COUNT (*) FROM table WHERE usuario=" + Globales.usuario +
" AND pass=" + Globales.contra;
MySqlCommand cmd = new MySqlCommand(query,conn);
cmd.CommandType = CommandType.Text;
conn.Open();
int num = (int) cmd.ExecuteScalar();
MessageBox.Show("Trying");
conn.Open();
MessageBox.Show(num.ToString());
MessageBox.Show("Fin");
conn.Close();
}
catch
{
MessageBox.Show("Error");
}
}
This code gives me a
"A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll"
and the MessageBox showing Error pops up.
What could be some possibilities that are happening? All the parameters such as connection to DB and the tables exist so....
Thanks!