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??

By Steve Novoselac

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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