J
John Veldthuis
I am trying to find instances of all the SQL servers on the local network including the machine it
is running from. The servers will be a mix of SQL2000 and SQL2005 once it is ready. I have been
trying it out with the PC on which the program is running also has SQL Server 2005 running on it at
the same time but the code will not pick this instance up. I call the following on the Form Load
Imports Microsoft.SqlServer.Management.Smo
Private Sub GetServers()
Dim dtable As DataTable
Dim drow as DataRow
if myServer <> String.Empty Then
cbServers.Items.Add(myServer) ' Add server we are currently using
End If
dt = SmoApplication.EnumAvailableSqlServers(False) ' this should get the list of servers
For Each dro In dtable.Rows
' populate combo box with server list
if drow(0).ToString <> myServer then cbServers.Items.Add(drow(0).ToString)
Next
End Sub
The server exists and I can use it if I type in the machine name but the above code fails to detect
it.
Any help?
is running from. The servers will be a mix of SQL2000 and SQL2005 once it is ready. I have been
trying it out with the PC on which the program is running also has SQL Server 2005 running on it at
the same time but the code will not pick this instance up. I call the following on the Form Load
Imports Microsoft.SqlServer.Management.Smo
Private Sub GetServers()
Dim dtable As DataTable
Dim drow as DataRow
if myServer <> String.Empty Then
cbServers.Items.Add(myServer) ' Add server we are currently using
End If
dt = SmoApplication.EnumAvailableSqlServers(False) ' this should get the list of servers
For Each dro In dtable.Rows
' populate combo box with server list
if drow(0).ToString <> myServer then cbServers.Items.Add(drow(0).ToString)
Next
End Sub
The server exists and I can use it if I type in the machine name but the above code fails to detect
it.
Any help?