Re: How to tell if a timeout exception occures by MrSmersh
MrSmersh
Fri Mar 10 03:25:26 CST 2006
Some of these (Iâ??ve tried to classify the most common exceptions) are in the
SQL Server documentation.
But for some is just plain debugging you got the exception look at the
message and you know now when occurs.
BTW: these are the values you going to get when using the native database
provider, for ODBC there are other conditions.
"Jeremy Chapman" wrote:
> Thanks. Are these numbers defined somewhere in the framework, because I
> can't find -2 documented there or in the sql documentation.
>
>
> "MrSmersh" <MrSmersh@discussions.microsoft.com> wrote in message
> news:87C17E73-E7DB-4A38-8A31-BD2062420C8E@microsoft.com...
> > if( sqlException.Number == -2 && sqlException.Class == 10 )
> > for a normal timeout this is what you get
> >
> > "Truong Hong Thi" wrote:
> >
> >> I suggest you check SqlException.Number. However, I don't know the
> >> error number for connection timeout, you may need to test to see.
> >>
> >>
>
>
>