validate Server connection

Nov 12, 2008 at 12:59 PM
Hi,

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?
Coordinator
Nov 12, 2008 at 11:11 PM
There is some code that does what you're describing:

<n2>
   <edit>
      <!-- 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 7: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?
Coordinator
Nov 13, 2008 at 9: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 12:57 PM
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!