Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:39:34+00:00 2026-06-04T08:39:34+00:00

i have code to find list of sqlserver public static string[] GetSQLServerList() { SqlDataSourceEnumerator

  • 0

i have code to find list of sqlserver

 public static string[] GetSQLServerList()
        {
            SqlDataSourceEnumerator dse = SqlDataSourceEnumerator.Instance;
            DataTable dt = dse.GetDataSources();
            if (dt.Rows.Count == 0)
            {
                return null;
            }

            string[] SQLServers = new string[dt.Rows.Count];
            int f = -1;
            foreach (DataRow r in dt.Rows)
            {
                string SQLServer = r["ServerName"].ToString();
                string Instance = r["InstanceName"].ToString();
                if (Instance != null && !string.IsNullOrEmpty(Instance))
                {
                    SQLServer += "\\" + Instance;
                }
                SQLServers[System.Math.Max(System.Threading.Interlocked.Increment(ref f), f - 1)] = SQLServer;
            }
            Array.Sort(SQLServers);
            return SQLServers;
        }

it work fine (if found SQL Server), but unfortunately it can not find sql Express.

anybody have an idea ?

Thanks you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:39:36+00:00Added an answer on June 4, 2026 at 8:39 am

    You need to enable the SQL Browser service for a SQL server instance to be browsable.

    SQL Express does not have this enabled by default.

    References:

    Enumerating Instances of SQL Server (ADO.NET)

    SQL Server 2000 provides information for the SqlDataSourceEnumerator internally. SQL Server 2005, however, provides the information through the use of an external Windows service named SQL Browser. This service is enabled by default, but administrators may turn it off or disable it, making the server instance invisible to this class. This service applies only to SQL Server 2005, and has no effect on the behavior of SQL Server 2000.

    Using SQL Server Browser

    By default, the SQL Server Browser service is not enabled for SQL
    Server Express. SQL Server Browser can be initially configured using
    the Surface Area Configuration Tool and managed using SQL Server
    Configuration Manager.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code similar to this: class Foo { List<Bar> _myList; ... public IEnumerable<Bar>
I have existing code that uses CMNewProfileSearch to find then iterate over the color
I have the code in which i want to find out the greatest number
I have borrowed code from this link PHP regex templating - find all occurrences
I have been trying to find a code snippet to do an unsharp mask
In my code base I find that two modules have structures with the same
I have been trying to find out why the following lines of code do
I have searched but can't find why this simple code will fail in Drools
I have the following code: var from = 0, step = 5; function showNext(list)
I have a function which returns a List<Dictionary<string, object>> where object is a standard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.