Re: exception GetType by jp2msft
jp2msft
Mon Mar 17 08:54:01 CDT 2008
DirectCast.
There is something new that I've learned today, and I've just added to my
book of spells.
Thanks!
"Phill W." wrote:
> John wrote:
>
> > What is the purpose of Exception.GetType
>
> Just as it does with any other Reference Type, GetType() returns you the
> runtime Type of the object in question.
>
> > and what are the possible values returned by it?
>
> [The Type of] /any/ class that inherits from System.Exception.
> (Or System.Exception itself, of course).
>
> > Can it for example tell me if the exception is of type
> > DBConcurrencyException?
>
> If TypeOf ex Is DBConcurrencyException Then
> With DirectCast( ex, DBConcurrencyException )
> ' Use exception
> End With
> End If
>
> HTH,
> Phill W.
>