here is the solution of ur prb ...
This code is to find out available servers on the LAN
<CODE>
//u need to give reference of COM Object SQLDMO.. its ships with sql server 2000
SQLDMO.ApplicationClass app = new SQLDMO.ApplicationClass();
SQLDMO.NameList list;
list=app.ListAvailableSQLServers();
int i=0;
while (i < list.Count)
{
MessageBox.Show(list.Item(i));
i++;
}
</CODE>
in order to execute this code u must should have updated sql server server pack
after getting the server u can ask the user to provide credential (login id & password) or use trusted connection
build the connection on the fly & use Master database as ur database in ur connection string
after that u have to collect all the databases in the selected sql server...
so u can use this query
<QUERY>
select * from INFORMATION_SCHEMA.SCHEMATA
</QUERY>
if u run the above query againt MASTER database it should give u the all the available database on the selected server which match credential u have provided ..
in case of any difficulty u can contact me ..
Hope this helps
Kamran Sorathia
2 Steps Solutions
92 321 2117267
Sharon <[EMAIL PROTECTED]> wrote:
I am trying to create a UI like the one in VS.Net where you create a database connection. A drop down with the list of sql servers, a dropdown with list of databases in the selected server. My problem is how can I get these information. or is there a way where i can use the one in vs.net. I need this to ship with the application.
All help is great help.
Thanks
Sharon
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "pakistan_dotnet" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
[Non-text portions of this message have been removed]
YAHOO! GROUPS LINKS
- Visit your group "AspNet2" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

