|
-
Oct 31st, 2007, 08:25 AM
#1
Thread Starter
Fanatic Member
[2005] ADO.Net Error Handling
I have a SQL Server SP that takes 3 parameters. My InsertCommand sets 2 of the 3 parameters and the 3rd one gets "default". When I call SqlDataAdapter.Update(), I don't get an error generated in my code, but the insert fails. If I run the exact same line in Query Analyzer, it returns "Procedure 'spName' expects parameter '@Param3', which was not supplied.
How can I test for this error situation? My application should not just continue to process data and make the user think it worked, when it actually did not.
My.Settings.Signature = String.Empty
-
Oct 31st, 2007, 08:36 AM
#2
Re: [2005] ADO.Net Error Handling
Try
-- put your .Update here
Catch sqlEx as SQLException
messagebox.show sqlex.tostring
Catch ex as SystemException
messagebox.show ex.tostring
Finally
--optional stuff here
End Try
-tg
-
Oct 31st, 2007, 08:40 AM
#3
Thread Starter
Fanatic Member
Re: [2005] ADO.Net Error Handling
I already have that in place. Nothing is caught there.
My.Settings.Signature = String.Empty
-
Oct 31st, 2007, 08:50 AM
#4
Fanatic Member
-
Oct 31st, 2007, 11:02 AM
#5
Re: [2005] ADO.Net Error Handling
If it's not catching it, then there's something else wrong... because I *Know* it does catch.... what does your code look like?
-tg
-
Oct 31st, 2007, 12:15 PM
#6
Thread Starter
Fanatic Member
Re: [2005] ADO.Net Error Handling
If there is an error inside of the procedure (a field is in a select list that doesn't exist in the table), it will catch that. It will not catch the "Procedure 'spName' expects parameter '@Param3', which was not supplied".
My.Settings.Signature = String.Empty
-
Oct 31st, 2007, 02:02 PM
#7
Re: [2005] ADO.Net Error Handling
Then by all means.... you go right ahead.... clearly you know what you are doing.
-tg
-
Oct 31st, 2007, 02:32 PM
#8
Thread Starter
Fanatic Member
Re: [2005] ADO.Net Error Handling
What's with the attitude? I came here asking for help, not an attitude.
My.Settings.Signature = String.Empty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|