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
 SQL connection status

Author  Topic 

juicyapple
Posting Yak Master

176 Posts

Posted - 2008-02-18 : 23:10:41
Hi,how to validate sql connection status is whether successful of failed (in terms of network) from asp.net?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-19 : 04:08:52
You can open connection inside a TRY..CATCH block. If the connection is unsuccessful, you can catch the error details inside CATCH block.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

juicyapple
Posting Yak Master

176 Posts

Posted - 2008-02-19 : 21:00:53
means I need to do some DML query within the try block?
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-02-20 : 00:05:18
No, just try to open the connection.

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

- Advertisement -