连接到SQL Server时出错 [英] Error while connecting to sql server

查看:138
本文介绍了连接到SQL Server时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经在.NET中创建了一个应用程序,该应用程序连接到在远程计算机上运行的SQL Server实例.我遇到的问题是,某些用户可以连接并正常使用该应用程序,但是对于某些用户,此错误消息即将到来...

"建立与服务器的连接时发生错误.连接到SQL Server时,此故障可能是由于以下事实导致的:在默认设置下,SQL Server不允许远程连接.(提供者:命名管道提供者,错误:40-无法打开与SQL Server的连接)(.Net SqlClient数据提供程序)"

我用谷歌搜索并尝试了以下方法:-
1)在Sql Server配置管理器中启用了命名管道和TCP/IP.
2)向我的防火墙添加了例外:a)sqlsrvr.exe b)sqlbrowser

我仍然遇到相同的错误.我不了解要解决的问题,因为有些用户可以连接,但有些用户却无法连接...
请帮忙......

在此先感谢...
问候
Jashobanta

Hi,
I have created an application in .NET that connects to an SQL Server Instance that runs in a remote machine. The problem I am getting is, some users can connect and normally use that application but for some users, this error message is coming...

"An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)"

I googled and tried the following :-
1) Enabled the Named Pipes and TCP/IP in Sql Server Configuration Manager.
2) Added the exceptions to my Firewall : a) sqlsrvr.exe b)sqlbrowser

Still I am getting the same error. I am not understanding what I need to do to resolve that as some users are able to connect but some users are not...
Please help...............

THANKS in ADVANCE...
Regards
Jashobanta

推荐答案

检查以下链接
http://www.scrumdesk.com/Articles/HowToEnableSQLServerRemoteConnections.html [ http: //blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx [
check below link
http://www.scrumdesk.com/Articles/HowToEnableSQLServerRemoteConnections.html[^]
http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx[^]


通常是外围应用配置错误或 sql服务配置问题.请查看此线程的潜在原因和解决方法: ^ ]

如果需要,请在此处参见设置外围应用配置的步骤. .

在这里,请查看以下与之相关的博客条目:
在默认设置下,SQL Server不允许远程连接 [ ^ ]
它说:
I.确保在外围应用配置器"工具中启用了远程连接"
二.检查是否在SQL Server配置管理器中启用了TCP/IP协议
三,确保SQL Server浏览器服务正在运行
Generally, it is surface area configuration error or sql service configuration issue. Have a look at this thread for potential reasons and resolutions: Resolving A network-related or instance-specific error occurred while establishing a connection to SQL Server[^]

If needed, See steps for setting up Surface area configuration here..

Here, look at the following blog entries related to the same:
Under the default settings SQL Server does not allow remote connections[^]
It says:
I. Make sure that Remote Connections are enabled in Surface Area Configuration tool
II. Check Whether TCP/IP protocol is enabled in the SQL Server Configuration Manager
III. Make sure that SQL server Browser service is running


这篇关于连接到SQL Server时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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