none
Follow up: "Can't find SQL Servers" RRS feed

  • Question

  • Hi Everyone,

    I got so frustrated trying to get my application to list my instances of SQL Server that I put it on hold for awhile.

    I am using VS2017 which is installed on my PC named MRM-WINX-001. I also have SSMS installed on the same PC.

    Using SSMS I can access my SQL Server 2017 instance which is installed on my PC named MRM-WINX-002. So it doesn't look like there is a problem on my home network. I can access SQL Server without any problems.

    So I went on the Internet and found the simplest example of listing instances of SQL Server.

    Imports System.Data.Sql
    
    Module Module1
    
        Sub Main()
            Dim instance As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance
            Dim table As System.Data.DataTable = instance.GetDataSources()
            DisplayData(table)
            Console.WriteLine("Press any key to continue.")
            Console.ReadKey()
        End Sub
    
        Sub DisplayData(ByVal table As System.Data.DataTable)
            For Each row As System.Data.DataRow In table.Rows
    
                For Each col As System.Data.DataColumn In table.Columns
                    Console.WriteLine("{0} = {1}", col.ColumnName, row(col))
                Next
    
                Console.WriteLine("============================")
            Next
        End Sub
    End Module

    When I ran the program my result was:

    It should have listed my PC MRM-WINX-002, but it didn't. Something is broken somewhere.

    Does anybody have any insights?

    Thanks,


    MRM256

    Wednesday, July 24, 2019 4:00 PM

All replies

  • There may be issues with a firewall rule or SQL Browser (in task manager as SQLBrowser) is off, should show as running.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, July 24, 2019 4:33 PM
    Moderator
  • Or TCP/IP is needed and disabled.

    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Wednesday, July 24, 2019 7:29 PM
  • Well, you would have had to configure MS SQL Server for Named Pipes protocol, TCP protocol or both for a client program to communicate with MS SQL Server. Named Pipes  is for inter-process communications between two programs running on the same computer, which would be the client program and MS SQL Server running on the same computer.

    TCP protocol allows a computer running the client program to remotely communicate with MS SQL Server over a network, along with some other internal services to be active on MS SQL Server. 

    https://web.synametrics.com/sqlexpressremote.htm
    • Edited by DA924x Thursday, July 25, 2019 7:08 AM
    Thursday, July 25, 2019 7:05 AM
  • Hi Karen,

    I ran the Task manager application and I could not find the SQLBrowser.exe in the running processes.

    Do I need to turn it on and set the task manager to include this process in the StartUp?

    Thanks,


    MRM256

    Thursday, July 25, 2019 1:14 PM
  • Hi Karen,

    I ran the Task manager application and I could not find the SQLBrowser.exe in the running processes.

    Do I need to turn it on and set the task manager to include this process in the StartUp?

    Thanks,


    MRM256

    I've never had it not be present. To start it see the following

    https://docs.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-browser-service?view=sql-server-2017#installing-uninstalling-and-running-from-the-command-line


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, July 25, 2019 1:22 PM
    Moderator
  • Hi Peter,

    I just check TCP/IP using the SQL Configuration Manager; it is enabled.

    Thanks,


    MRM256

    Thursday, July 25, 2019 1:39 PM
  • Karen,

    On MRM-WINX-002; the SQL Server PC. Using SQLServerManager.msc, I set the SQL Server Browser to automatic, Restarted the PC and tried to run the simple application to show SQL Server instances on the network.

    Same result; no instances listed.

    What now?

    Thanks,


    MRM256

    Thursday, July 25, 2019 3:38 PM
  • Try running SQLServerManager.msc (see the following page)


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, July 25, 2019 3:51 PM
    Moderator
  • Hi Karen,

    I reran SQLServerManager14.msc and got the same thing in your message. What am I looking for? What am I suppose to correct?

    Thanks,


    MRM256

    Friday, July 26, 2019 3:33 PM
  • Hi Karen,

    I reran SQLServerManager14.msc and got the same thing in your message. What am I looking for? What am I suppose to correct?

    Thanks,


    MRM256

    I wanted to see those settings, they seem correct.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, July 26, 2019 3:38 PM
    Moderator