provider:命名管道提供程序,错误:40 –无法打开与SQL Server的连接. [英] provider: Named Pipes Provider, error: 40 – could not open a connection to SQL server.

查看:446
本文介绍了provider:命名管道提供程序,错误:40 –无法打开与SQL Server的连接.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个依赖于sql server数据库的.net应用程序,该数据库位于用于开发该应用程序的本地计算机上.

I developed a .net application that depends on a sql server database, the database was on the local machine used for development of the application.

将数据库移至远程计算机并更改连接字符串时,出现以下错误:

When I moved the database to a remote machine and changed the connection string I got the following error:

在连接到SQL Server 2005时建立与服务器的连接时发生错误,此失败可能是由于在默认设置下SQL Server不允许远程连接这一事实引起的. (provider:命名管道提供程序,错误:40 –无法打开与SQL Server的连接.)

An error has occurred while establishing a connection to the server when connecting to SQL server 2005, this failure may be caused by the fact that under default settings SQL server does not allow remote connection. ( provider: Named Pipes Provider, error: 40 – could not open a connection to SQL server. )

此错误仅在XP计算机上出现,但在Win上可以正常使用. 7台具有相同连接字符串的机器:

This error occurs only from XP machines but it works fine from Win. 7 Machines with the same connection string:

connectionString ="Data Source = ot;初始目录= sp_warehouse;用户ID = fu;密码= bar"

connectionString="Data Source=ot;Initial Catalog=sp_warehouse;User ID=fu;Password=bar"

我尝试了以下方法来解决问题: -从服务器禁用命名管道服务. -在服务器防火墙中为SQL Server端口1433添加了一个例外 -完全禁用了服务器上的防火墙 -在连接字符串中添加了此参数:Network Library = DBMSSOCN; Persist Security Info = True

I tried the following to troubleshoot the problem: - Disabled Named Pipes service from the server. - Added an exception in the server firewall for the SQL Server port 1433 - Disabled the firewall on the server completely - Added this parameter in the connection string: Network Library=DBMSSOCN;Persist Security Info=True

每次尝试一些尝试,我都会得到相同的结果,赢得胜利. 7台机器可以正常工作,而XP机器则不能.

Each time I try something I get the same result, win. 7 machines work fine but XP machines don't.

注意:XP机器上还有另一个应用程序可以在同一SQL Server上使用另一个数据库,并且可以正常工作.

Note: There's another application works from XP machines that uses another database on the same SQL Server and it's working fine.

推荐答案

请确保SQL浏览器已启用并在远程计算机上运行.您可能要使命名管道保持启用状态.

Make sure the SQL Browser is enabled and running on your remote machine. You'll probably want to leave named pipes enabled.

这篇关于provider:命名管道提供程序,错误:40 –无法打开与SQL Server的连接.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆