9
votes

How can I force my ASP.Net application to connect to a SQL Server using TCP/IP, not Named Pipes?

I read somewhere putting "tcp:" in front of the server name in the connectionstring should do the trick, but it does not seem to change anything.

Edit1:

  • TCP/IP is enabled on the SQL Server.
  • I tried Network Library=dbmssocn in the connectionstring, I still get an errormessage about named pipes: "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

Edit2:

  • Turns out my problem was another hidden connectionstring used by entity framework
4

4 Answers

4
votes

Use the SQL Server Configuration Manager on the client and disable the client protocols you don't want it to use.

0
votes

It depends how you're connecting to the database, but this should give the information you need.

0
votes

Just to add a quick hint, could cause issues, if you need to specify a port, do it after the IP address, and use a comma, not a colon.