what will be the http error code (ex. 404, 500) produced when an sql server is down due to maintenance works? thanks in advance =)
HTTP Error code of SQL server down
Collapse
X
-
in that case it would act as if your application was connecting to a non existant database.
And will throw an exception.
If that exception is not caught, it will show a very non-informational data to the "common" user.
So the catch here is to catch the exceptionComment
-
what exception will it throw? i am creating a custom error page specifically for sql server that is under maintenance. right now, im using error code 500 internal server error. is this correct? or is there any more appropriate error code to use?
thank you very much...Comment
-
I think that would depends upon how much of the server is down.
If the entire server is down then the instance of the server will not be found,
If only the database is down then the initial catalogue will fail.
not sure of the exact errors though.
you could try that by playing with your connection string.
Edit: I tried that....on both occasions it gives SqlException. However with different messages (but if you do recieve this exception, it should probabl be because of this reason, it will also throw this exception if there is a non existing stored procedure / funtion which has been called)
cheersLast edited by Shashi Sadasivan; Oct 23 '07, 07:00 AM. Reason: tried the combinations, another reason for exceptionComment
-
Hi there,
I'm not a .NET pro but you could use Try... Catch to attempt retrieval of data, then if the database server is down for whatever reason, you use code in the Catch to handle the error and show something nice and user-friendly.
Best regards,
medicineworkerComment
Comment