September 10, 2008 at 5:08 am
accessing named instances
--------------------------------------------------------------------------------
hello
I installed two named insances of SQL Server 2005 on Win 2003 server.
I hv written small appl which list out all the insances of SQL Server available on network .
but it is not working , it is displaying only names of SQL Server.
Code---
Dim dtSQLServers As DataTable
dtSQLServers = SmoApplication.EnumAvailableSqlServers()
Dim strServer As String
For Each dr As DataRow In dtSQLServers.Rows
strServer = CStr(dr("Server"))
'strServer = dr("Server") & "\" & CStr(dr("Instance"))
If Not TypeOf dr("Instance") Is DBNull AndAlso CStr(dr("Instance")).Length > 0 Then
strServer += "\" & CStr(dr("Instance"))
End If
comboServer.Items.Add(strServer)
Next
----------------
is there any other method for this.
Firewall is off on server.
Thanks
Viewing 0 posts
You must be logged in to reply to this topic. Login to reply