Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi,
i use windows server 2008r2, visual studio 2010 and sql server management studio.
i need to create a form in which user should enter database server name and on click of a button 'check' it should check my local system for that database server and if found it should redirect to next page or else if not found show messagebox with messgae "database server not found". if the entered database server is found it should open next form and on the next form it should ask for entering username and password to connect to that server.
 
how do i do it?
pls help me out with this issue.Any help will be appretiated.
Thanks in advance
Posted 15-Jan-13 20:19pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could use WMI to check if a server exists and if you can connect to it - http://support.microsoft.com/kb/q287737[^].
 
Another approach could be to try and connect to each listed server and see if you get a positive response.
A simple ping would tell you if the server actually exists.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Is the database and the asp.net application is hosted on the same location or they are on different servers????
 
If they are on same location then you can use the SQLConnection to check whether the database server exists or not.
 
You can go to the link below to understand it more better
 
http://www.dotnetperls.com/sqlconnection[^]
 
Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 495
1 Sergey Alexandrovich Kryukov 479
2 OriginalGriff 360
3 Abhinav S 250
4 CHill60 240
0 Sergey Alexandrovich Kryukov 10,102
1 OriginalGriff 9,495
2 Peter Leow 5,241
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,076


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100