Home Forums SQL Server 2005 Administering How to list all the instances and the port they are listening RE: How to list all the instances and the port they are listening

  • Hi

    Code to do this in VB. (I think this came from a help file somewhere)

    Function FindServers() As DataTable

    Dim instance As System.Data.Sql.SqlDataSourceEnumerator = System.Data.Sql.SqlDataSourceEnumerator.Instance

    Dim dataTable As System.Data.DataTable = instance.GetDataSources()

    Return dataTable

    End Function

    HTH

    pg