Groups | Blog | Home
all groups > dotnet ado.net > july 2005 >

dotnet ado.net : Check to ensure server and db available


Earl
7/30/2005 3:07:28 AM
When I load the startup form, I want to make a check to ensure the named
server AND database (SQL2k) is available before trying to load any data. Any
recommendations?

Scott M.
7/30/2005 9:10:52 AM
..... configure and instantiate connection object...

Try
connection.open()
Catch ex As Exception
'Handle inability to open connection here
Finally
connection.close()
End Try


[quoted text, click to view]

William (Bill) Vaughn
7/30/2005 9:27:58 AM
The 2.0 Framework has a number of new "factory" classes and service classes
that make this easy. I'll be showing those at VSLive in Orlando in October.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

Miha Markic [MVP C#]
7/30/2005 10:15:53 AM
Try a connect (embedded in try/catch block).

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

[quoted text, click to view]

Earl
8/1/2005 8:14:01 PM
Thanks for the thoughts guys. Just thought maybe there was something more
elegant than capturing an exception :=)

Oh, and when are we to see 2.0 Bill?

[quoted text, click to view]

William (Bill) Vaughn
8/2/2005 8:33:03 AM
You can work with it now. The CTPs are fairly stable and good enough to
start building and testing applications for delivery in 2006.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

Earl
8/2/2005 4:01:42 PM
Will do. I actually meant to write that as "... 2.0, Bill", but figured I
might get a response out of "...2.0 Bill" also. =)

[quoted text, click to view]

Earl
8/11/2005 10:17:00 PM
You have a recommendation on which event to fire this in? Obviously, I could
do the check when a user presses a button, but I'd much rather do it while
the form is loading. I've experimented a bit with this and none of the Form
events seem appropriate.

[quoted text, click to view]

AddThis Social Bookmark Button