February 1, 2007 at 2:00 am
Hi,
I'm trying to catch an exception in my .NET application when SQL server 2005 express stops responding.
Everything works fine, but when I stop server service in the middle of my application running (there can be many reasons why service may stop) I receive a bunch of errors! Since I'm using Try.. Catch ex as SQLException, the message numbers that are returned wary: -1, 0, 2, 40, 232, 233 etc. The message depends on wehter I'm using local server or network connection, wether I'm trying to connect to non-responding server for the first time or any other time, even depends on location in code - where I'm openinig SQL connection.
Is there any simple way to cath the error and provide user with a MsgBox saying 'Your server stops responding, please chek your network cable' or something like that?
February 8, 2007 at 12:47 am
Thak you! I will appreciate it.
I thik this is a problem, but i seems that nobody bothers with it...
February 8, 2007 at 3:46 am
I can't figure out an easy way. With enterprise library of .NET you can relaunch technical exceptions with user-friendly error messages.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply