We can discover error code, checking property Number of class MySqlException.
try
{
connection.Open();
}
catch (MysqlException ex)
{
switch (ex.Number)
{
case 0:
return "Cannot connect to server";
break;
case 1045:
return "Invalid username/password, please try again";
break;
}
}
For a complete errors number list plaese referrer to http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html and in the
share/errmsg.txt
file
No comments:
Post a Comment