Discovering named instances

Given: VB.net .Net Framework 1.1

In my program I use ODBC:SQLDataSources to discover available SQL Servers. I have recently realized that my code does not discover the Named Instance of SQL2005 which runs along side SQL2000 on my machine. I believe that .Net Framework 2.0 has a new function for SQL Server enumeration but I need to remain at the 1.1 level for some time.

Is there a better way to discover SQL Servers which will discover the Named Instances in addition to the defauls instances



Answer this question

Discovering named instances

  • Kumar_77

    Thanks Mr. Vaughn. Unless I'm missing somethign I believe the technique you show uses a function available only in .Net Framework 2.0.

    What technique would you use to discover all instances (dafault or named) using VS.Net2003 and .Net Framework 1.1


  • TomConner

    I posted a block of code here in this forum earlier in the week to do just that.

  • Beverly

    Yup, this is new functionality for 2.0. It's a lot harder in 1.1. I would probably use NetServeEnum API calls, but ... those are problematic too. It's one reason why they added the functionality.

  • Discovering named instances