none
Timeout sqlexceptions RRS feed

  • Question

  •  

    HI!

     

    I need to differentiate between sqlexceptions that are timeouts and all other sqlexceptions.  I've seen mentioned on a couple of threads that the timeout detected sqlexception.number is -2 but there doesn't appear to be any real confirmation of this.  Other threads say don't use the number because it might change - then what else is there?  Parsing the message for "Timeout detected" doesn't seem reliable long-term as messages can change...and there's no SQLTimeOutException that I can find.  So has anyone been able to successfully and reliably use -2 (or some other method)?

     

     

    Thanks!

     

    GlennL

    Monday, October 1, 2007 2:37 PM

All replies

  • Checking for the error number probably is the most reliable way of all that exist, until Microsoft does start to generate appropriate exceptions (if they do)

    Monday, October 1, 2007 11:05 PM
    Moderator