validate Server connection

Nov 12, 2008 at 11:59 AM

I would like to validate if the databaseserver I'm connecting to is up and running.
If it is not, I would like to redirect the user to a specific page.

Where should I start?
Nov 12, 2008 at 10:11 PM
There is some code that does what you're describing:

      <!-- Set checkInstallationStatus to false to disable redirect to install page -->
      <installer checkInstallationStatus="true" />

You can also change the redirection url:
      <installer checkInstallationStatus="true" installUrl="~/MyPath.aspx" />
Nov 13, 2008 at 6:32 AM
I did have that part in mind, but I figured it would be to much overhead....don't you think so?
Is there any way to intervene on a database-exception?
Nov 13, 2008 at 8:51 PM
Can you use custom errors in web.config?

    <customErrors mode="On" defaultRedirect="~/somewhere.aspx" />

Or perhaps an HttpApplication.Error event?
Nov 14, 2008 at 11:57 AM
I actually do have a custom class to catch any exceptions that occur's which notifies me with an e-mail.
Thinking about it, I should just extend that class and catch the database exceptions...

Thanks for pointing me in the right direction!