Categories
Geeky/Programming

SQL Exception Handling in .NET

In .NET , Microsoft introduced the Try, Catch, Finally exception handling. In all books and examples I have seen, you catch an exception like so:

Try
…some code
Catch ex as Exception
…some error handling code
End Try

Well, what happens when you are catching a SQL Exception?

Try
…some code
Catch sEx as SqlException
…some error handling code
End Try

Is Microsoft trying to tell us something here??

Steve Novoselac's avatar

By Steve Novoselac

Director of Digital Technology @TrekBikes, Father, Musician, Cyclist, Homebrewer

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.