How to check if the server is available!!

Eteleeb

New member
Joined
Apr 6, 2005
Messages
4
Programming Experience
Beginner
Hi People,

In my application I should connect to SQL Server first. therefore, I would like to know how to check if the SQL Server is availaible or no. in other words, when I click connect to the server button, I should check if the server is available or no.
Please can someone tell me how

Thanks
Eteleeb
 
Hi,
Try to open the connection if u get any exception that means ur either ur server does not exist or u don't have permission..........

e.g
try
consql.Open
consql.Close
Catch exc as SqlException
Messagebox.show("server does not exist or u don't have permission")
End try

I hope this will help u..................

Regards,
Ritesh

 
Back
Top