PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Error Codes From Oracle
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Error Codes From Oracle
![]() |
Error Codes From Oracle |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
I am having a wierd problem. I am using an OleDBCommand to insert a new row into a table on an Oracle 10g database. My Code looks like this bool result = ( command.ExecuteNonQuery( statement ) > 0 ); last night the Oracle Database was hung due to some issues with the file sizes or something I am not sure . The problem is, is that all of the inserts in my code passed, meaning that result was true, and no exceptions where thrown. is there a way to get a return / error code from the ExecuteNonQuery()? All I have read says that the return is the number of rows affected. if this returns 1 but Oracle did not actually insert the row, the only way for me to tell is to select back out the row to make sure it is there. I kinda do not want to do that. Any help would be appreciated thank you in advance Tim |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Tim,
In a case of error, ExecuteNonQuery suppose to throw an exception. You do not need to check for error. If you are sure that ExecuteNonQuery returns 1 and database is not updated, then it looks like a bug in a provider or something is wrong on a database side. Another potential issue is the if inserts were done inside of the transaction, then ExecuteNonQuery returned 1 for each insert, but transaction was automatically rolled back after server crashed. In this case you will not see any updates in a database -- Val Mazur Microsoft MVP http://xport.mvps.org <tim.romanowski@gmail.com> wrote in message news:1139445276.932771.284890@g44g2000cwa.googlegroups.com... > Hello, > > I am having a wierd problem. I am using an OleDBCommand to insert a > new row into a table on an Oracle 10g database. > > My Code looks like this > > bool result = ( command.ExecuteNonQuery( statement ) > 0 ); > > last night the Oracle Database was hung due to some issues with the > file sizes or something > I am not sure . > > The problem is, is that all of the inserts in my code passed, meaning > that result was true, > and no exceptions where thrown. > > is there a way to get a return / error code from the ExecuteNonQuery()? > > > All I have read says that the return is the number of rows affected. > if this returns 1 but Oracle did not actually insert the row, the only > way for me to tell is to select back out the row to make sure it is > there. I kinda do not want to do that. > > Any help would be appreciated > > thank you in advance > > Tim > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

