PDA

Click to See Complete Forum and Search --> : Sql Server and Database Listing


ggoodson
Jun 17th, 2002, 07:55 AM
Does anyone know how to get a list of Sql Server's using VB.NET.
Also once a user selects a particular server to give a list of databases.


Cheers

Shadow_of_VB
Sep 12th, 2002, 10:14 AM
Any idea on this one yet... this is my question also :)

Thanks,
Jon

SThornton
Dec 12th, 2002, 04:08 PM
Hi,

Add a reference to SQL DMO

Dim oApp As SQLDMO.Application
Dim oNames As SQLDMO.NameList

oApp = New SQLDMO.Application()
oNames = oApp.ListAvailableSQLServers

Dim i As Integer
For i = 1 To oNames.Count
Me.cboServerName.Items.Add(oNames.Item(i))
Next

StormJason
Dec 19th, 2002, 07:50 PM
Sorry for my interruption, actually i am looking for this as well. i have try the posted code but i get the following error message...

QueryInterface for interface SQLDMO.NameList failed.

do you have any idea about this?

SThornton
Dec 19th, 2002, 08:28 PM
Hi,

You will probably need the latest version of sqldmo.dll. I guess if you update/install MS SQL Client Tools it should work.

StormJason
Dec 19th, 2002, 08:58 PM
Hi! thanks for your reply... but where can i find the update?

SThornton
Dec 19th, 2002, 09:01 PM
Mmmm,

The Microsoft SQL Server website would be a good start.

We downloaded it ages ago and keep a copy of the file laying around...