Hi mysql dotnet list,
I have started using the (v5.0.6.0) connector's asynchronous reader, and
it works pretty well. But I can't figure out how to get a useful
exception back in case of an error, since EndExecuteReader only returns
a null. For example:
mySqlCommand.CommandText = "SELECT this_sql_has_a_syntax_error FROM
atable";
IAsyncResult asyncResult = mySqlCommand.BeginExecuteReader();
// ...
IDataReader reader = mySqlCommand.EndExecuteReader(asyncResult);
if (reader == null) {
// something went wrong, but what?
}
The synchronous version, MySqlCommand.ExecuteReader, would throw some
sort of exception (probably a MySqlException) if something went wrong.
I figure the asynchronous call must have some way to get at this same
exception, but I can't figure out what it is. Does anyone know how to
do this? Thanks,
-kd