OdbcException
Hi
I'm trying to get an OdbcException when I execute a query
with a closed connection but I only get a normal exception
my code is:
try {
string query = "Select * from users";
OdbcCommand cmm = new OdbcCommand(query,conn);
object result = cmm.ExecuteScalar();
}
catch(OdbcException Ex1)
MessageBox.show(Ex1.Message);
catch(Exception Ex2)
MessageBox.show(Ex2.Message);
Then I guess that I get an OdbcException if my connection
is closed but I get an normal Exception.
Whats is wrong???
Regards
|