简体   繁体   中英

How to get SQLCode even when no exception is thrown from DB2 database using OleDbConnection class in C#.NET

  1. How to get sqlcode even when no exception is thrown from DB2 database using OleDbConnection class in C#.NET?

For example:

When there are no rows returned for update & delete query the sqlcode is 100 but how will I get it in OledbConnection?

  1. As well when using the select query when no rows are returned, I need to get the SQLCode ? SQLCode = 0 Successfull ? SQLCode = 0 Successfull , SQLCode = <0 Exceptions , SQLCode > 0 Warnings ( 100 - no rows returned ) .

It is recommended to use the IBM Data Server provider for .Net instead of the generic OLEDB provider; the IBM provider has the DB2Error class , which has the information you want to retrieve.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM