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

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s