Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 How to detect to see if database not available?

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-08-27 : 14:27:53
I met this situation:
SQL server is on line but database is not available.
How to detect it and display error message at page load event?

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-08-27 : 14:44:49
Just Try{} to connect to the database and Catch{} an exception if it fails.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2007-08-27 : 15:16:47
Thanks, you gave me a point.
Go to Top of Page
   

- Advertisement -