How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

前端 未结 30 2542
借酒劲吻你
借酒劲吻你 2020-11-22 08:27

I can\'t seem to connect to my database from a site. I get this error:

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

相关标签:
30条回答
  • 2020-11-22 09:13

    If you are working with Asp.net core and using appsettings.json than write server as localhost and after write sql instance name for enabled named pipe like this

      "ConnectionString": {
        "dewDB": "server=localhost\\dewelopersql;database=dewdb;User ID=sa;password=XXXXX",
      },
    
    0 讨论(0)
  • 2020-11-22 09:14

    I had the same problem and solved the problem by disabling my firewall(ESET).

    The first step to solve this problem should be to try pinging your own computer from another computer. If you have firewall on, you may not be able to ping yourself. I tried pinging my own pc, then ping was failed(didnt get response from the server)

    0 讨论(0)
  • 2020-11-22 09:15

    I tried using the local IP address to connect as well as a public one. I've tried:

    Yes, the site can communicate with the server Named pipes/TCP is enabled. Remote connections are allowed. Windows Firewall is off Created an exception for port 1433 in Windows Firewall. Enabled everything in SQL Server Configuration Manager.

    i ensured and did the above as well and I just want to share that the DOUBLE BACKSLASH

    oBuilder.DataSource = "SPECIFICPCNAME\SQLEXPRESS";

    Using a SINGLE BACKSLASH resulted into a build error i.e.: Error 1 Unrecognized escape sequence

    I hope this helps the next guy - I've sacrificed dinner, midnight snack and NBA highlights time solving this (shame)

    Thanks to [Tamizh venthan] ^_^

    0 讨论(0)
  • 2020-11-22 09:15

    Open SQL Server Configuration Manager

    1. Select SQL Server Services from right.
    2. Find your server from right and go to its properties (with right click)
    3. Change log on method to Local System.

    enter image description here

    enter image description here

    0 讨论(0)
  • 2020-11-22 09:16

    I had just installed SQL SERVER 2012 developer. When I was creating my first SSIS package, I received this pipes error when I was trying to create a data connection task in SQL Server 2012 Data Tools in the Connection Manager box. I resolved with the help of the post above.

    If choose a named instance and you call your named instance SSQDatabase1 and your pc's name is PCX1. You must enter PCX1\SSQDatabase1 not just SSQDatabase1 or you will receive the named pipes error.

    0 讨论(0)
  • 2020-11-22 09:16

    In my case, I opened SQL Server Management Studio and searched for SQLEXPRESS in my Database engine. It had two instances and I selected the correct one.

    0 讨论(0)
提交回复
热议问题