Error handling in SQL?
TRY…CATCH (Transact-SQL)
How to handle errors in C#?
Try, Catch Finally
- Using Exceptions (C# Programming Guide)
- Exception Handling (C# Programming Guide)
- Creating and Throwing Exceptions (C# Programming Guide)
- Compiler-Generated Exceptions (C# Programming Guide)
- How to: Handle an Exception Using try/catch (C# Programming Guide)
- How to: Execute Cleanup Code Using finally (C# Programming Guide)