强制ASP.Net使用TCP/IP连接到SQL Server而不是命名管道 [英] Forcing ASP.Net to use TCP/IP to connect to SQL Server instead of named pipes
本文介绍了强制ASP.Net使用TCP/IP连接到SQL Server而不是命名管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何强制我的ASP.Net应用程序使用TCP/IP(而不是命名管道)连接到SQL Server?
How can I force my ASP.Net application to connect to a SQL Server using TCP/IP, not Named Pipes?
我在某处读到了"tcp:"服务器字符串前面的服务器名称前面的方法应该可以解决问题,但是似乎并没有改变任何内容.
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.
- 在SQL Server上启用了TCP/IP.
- 我在连接字符串中尝试了Network Library = dbmssocn,但仍然收到有关命名管道的错误消息:提供者:命名管道提供程序,错误:40-无法打开与SQL Server的连接"
- 原来我的问题是实体框架使用了另一个隐藏的连接字符串
推荐答案
您可以在连接字符串中强制使用它:
You can force it in the connection string:
server=tcp:hostname
通过: 查看全文