.NET Questions (CLOSED)

Questions and Answers on any aspect of .NET. Now closed.

This discussion group is now closed.

Have a question about .NET development? Try stackoverflow.com, a worldwide community of great developers asking and answering questions 24 hours a day.

The archives of .NET Questions contain years of Q&A. Even older .NET Questions are still online, too.

Error Trapping of Database errors

I have a .net windows app that calls stored procedures and acts as a controlling "ETL" (Extract, Transform, Load). During the "Load", i call a stored procedure that will do load table from a table into the Real Database. I want to "trap" and not trigger an error for messages that occur during the "load" stored procedure. However, if an incorrect parameter is passed into the "load" stored procedure that is missing, then I want the error message to occur.

How can I do this short of hardcoding. In the past I have done things like:

if (!(ex.Source.StartsWith(".Net SqlClient Data Provider")))

but I realize this won't work.
Patrick from an IBank Send private email
Wednesday, January 03, 2007
 
 
Catch SqlException. Look at the Errors collection to figure out if you want to handle it or re-throw it.
Mike S Send private email
Wednesday, January 03, 2007
 
 
mike thanks, but i feel like i'm going to have to blantantly hardcode to trap linked server errors, parameters, etc.
Patrick from an IBank Send private email
Wednesday, January 03, 2007
 
 
Yes, I don't know of a better way to sort out the different errors you might get from executing a stored proc...
Mike S Send private email
Wednesday, January 03, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz