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
Printable View
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
Any idea on this one yet... this is my question also :)
Thanks,
Jon
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
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?
Hi,
You will probably need the latest version of sqldmo.dll. I guess if you update/install MS SQL Client Tools it should work.
Hi! thanks for your reply... but where can i find the update?
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...