c# - Get exception details from batch statement -
i've got application connect mysql 5-server via odbc-driver. i'm using prepared/parameterized batch-statements move data around @ server. working great, until moment goes wrong...
insert blabla select blablabla; insert blabla select bliblibli; update blabla; // etc.
now if statement goes wrong, unhelpful exception:
system.data.odbc.odbcexception error [hy000] [mysql][odbc 3.51 driver][mysqld-5.0.26-pro-nt]unhandled error mysql_next_result() @ system.data.odbc.odbcdatareader.nextresult(boolean disposing, boolean allresults) @ system.data.odbc.odbcdatareader.nextresult() @ system.data.odbc.odbcdatareader.firstresult() @ system.data.odbc.odbccommand.executereaderobject(commandbehavior behavior, string method, boolean needreader, object[] methodarguments, sql_api odbcapimethod) @ system.data.odbc.odbccommand.executereaderobject(commandbehavior behavior, string method, boolean needreader) @ system.data.odbc.odbccommand.executenonquery() @ myapp.myclass.mydata.whyareyoureadingthis()
the innerexceptions null.
am able extract further information problem? f.e. if i'm not using batch-statement, exact error message back, not if have batch-statement.
not sure if solve problem (more details in db exceptions), have considered using .net connector mysql (aka ado.net driver mysql) instead of odbc driver?
you can download connector here: http://www.mysql.com/products/connector/
update:
looked in msdn @ odbcexception class. seems has property called errors holds collection of odbcerror classes. instance of classes should have description of each of encountered errors. please let me know if helps.
update2:
seems year ago bug has been submitted mysql team related problem facing: http://bugs.mysql.com/bug.php?id=49466
the bug doesn't seem fixed there nothing can in .net application.
in bug description being said odbc connector specific problem. not 100% sure case. if ever switch .net connector please post message , let know if solved problem.
Comments
Post a Comment