trapping sqlexception
-
I have the following problem. Whenever we pass an insert statement against database table, if anything goes wrong the exception can be cathced by using sqlexception parameter. I have done with exception where there is a problem with the primary key because i know the error code it genereates when there is a primary key error. But how can i do the same type of checking when there is an error related to foreign key. Wht is the error code for foreign key related errors. Is there any other approach for doing this kind of things Any suggestion is well received. thanx in advance
-
I have the following problem. Whenever we pass an insert statement against database table, if anything goes wrong the exception can be cathced by using sqlexception parameter. I have done with exception where there is a problem with the primary key because i know the error code it genereates when there is a primary key error. But how can i do the same type of checking when there is an error related to foreign key. Wht is the error code for foreign key related errors. Is there any other approach for doing this kind of things Any suggestion is well received. thanx in advance
In the past, I have been able to get sql errors by looking at the inner exception of the exception that gets thrown in .Net.