enumerate Microsoft sql server instance in local network
-
hi all, i want to list out all the instance of SQL server. i use following code for this purpose
Dim instance As System.Data.Sql.SqlDataSourceEnumerator = System.Data.Sql.SqlDataSourceEnumerator.Instance() Dim table1 As System.Data.DataTable = instance.GetDataSources() For Each row As DataRow In table1.Rows If cboServer.Items.Contains(row.Item(0).ToString) Then Else cboServer.Items.Add(row.Item(0).ToString) End If Next
but some time above code does not enumerate all the instance of sql server on local network. so i want to ask whether there are any method which enumerate all the instance of sql server which is located on my local networkRupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11
-
hi all, i want to list out all the instance of SQL server. i use following code for this purpose
Dim instance As System.Data.Sql.SqlDataSourceEnumerator = System.Data.Sql.SqlDataSourceEnumerator.Instance() Dim table1 As System.Data.DataTable = instance.GetDataSources() For Each row As DataRow In table1.Rows If cboServer.Items.Contains(row.Item(0).ToString) Then Else cboServer.Items.Add(row.Item(0).ToString) End If Next
but some time above code does not enumerate all the instance of sql server on local network. so i want to ask whether there are any method which enumerate all the instance of sql server which is located on my local networkRupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11
I use SmoApplication.EnumAvailableSqlServers()[^], which seems to work reliably for me.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”