Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Howto get an error back from an async query

From: Reggie Burnett <reggie(at)mysql.com>
Date: Thu Aug 23 2007 - 09:55:49 EDT


I'll check this out.
> 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
>
>
>
>
>

-- 
MySQL on .NET Mailing List
For list archives: 
http://lists.mysql.com/dotnet
To unsubscribe:    
http://lists.mysql.com/dotnet?unsub=lists@pantek.com
Received on Thu Aug 23 09:57:24 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:15:41 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library