Finding the row that caused an exception

liquidchild

Member
Joined
May 1, 2008
Messages
7
Programming Experience
3-5
Hi,

I am using datatables to insert data into an oracle database, but get a unique constraint violation when doing the .update(), is it possible to output the details of the row that gave the exception?

Thanks
 
ehm..

in the debugger, i'd just take a look a tthe parameters of the relevant update command in the tableadapter

at runtime, i'd be tempted to write the code myself and pass each row individually..
ther emight be better ways, i havent researched,,
 
What is the exact type of the exception that gets thrown? For an SQL database it would be an SqlException, which has an Errors property that contains SqlError objects. I don't know for sure but I'd guess that the specific value that cause the issue would be identified by an SqlError. Perhaps Oracle provides similar information. I just had a look at the OracleException class and it doesn't have a similar property but the InnerException would be worth checking out.
 

Latest posts

Back
Top