数据库连接问题,加急!!!!

xcrow713 2008-07-09 11:26:36
用SQL工具可以连接服务器上的数据库,但是程序运行就会抛出这样的错,连接字符串正确,防火墙已关闭,其他人的机器都正常:
System.ServiceModel.FaultException`1[NCS.IConnect.Common.ServiceException]: 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 the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.Data.SqlClient.SqlException: 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 the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignor...).
...全文
161 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yagebu1983 2008-07-10
  • 打赏
  • 举报
回复
你在本地直接访问数据库试试!!!
xcrow713 2008-07-10
  • 打赏
  • 举报
回复
没人知道啊
xcrow713 2008-07-09
  • 打赏
  • 举报
回复
我直接用SQL访问是没有问题的,就是程序运行的时候就不行,杀毒软件也不是金山
liaolezhong 2008-07-09
  • 打赏
  • 举报
回复
我想说你应该装的杀毒软件是 金山。他对程序有不好的位置。你可以把杀毒软件卸下。试下。。
报错说 服务器连接错误。检查下服务器。
chengqscjh 2008-07-09
  • 打赏
  • 举报
回复
是否是权限的问题,连接不上或不让访问
xcrow713 2008-07-09
  • 打赏
  • 举报
回复
启用了
asdfgh_5982 2008-07-09
  • 打赏
  • 举报
回复
provider: Named Pipes Provider, error: 40 错误点在这里,

应该是sql客户端连接协议中named piped和tcp/ip协议没有启用
xhan2000 2008-07-09
  • 打赏
  • 举报
回复
估计用的sql2005

看看sql的tcp/ip服务协议启动没
mextb1860 2008-07-09
  • 打赏
  • 举报
回复
sql可能有问题.
xcrow713 2008-07-09
  • 打赏
  • 举报
回复
没人知道吗,我把SQL卸载了重装
烈火焚身 2008-07-09
  • 打赏
  • 举报
回复
up

17,747

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧