> if (someobject.GetType()) == typeof(SqlException) ...
>
[quoted text clipped - 13 lines]
> >
> > Thanks in advance
> Thanks a lot Kevin!
>
[quoted text clipped - 7 lines]
> ...
> End If
No, that will never work - because you're getting the type of the
return value of GetType(), which is always going to be System.Type,
never System.Data.SqlClient.SqlException
Just use
If TypeOf objSomeObject Is System.Data.SqlClient.SqlException
Or, as I said, just throw the exception.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too