Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. enumerate Microsoft sql server instance in local network

enumerate Microsoft sql server instance in local network

Scheduled Pinned Locked Moved Visual Basic
sysadmincsharpdatabasesql-server
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rupesh Kumar Swami
    wrote on last edited by
    #1

    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 network

    Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

    H 1 Reply Last reply
    0
    • R Rupesh Kumar Swami

      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 network

      Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      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.”

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups