加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 无法打开与SQL Server的连接

发布时间:2020-12-16 07:02:43 所属栏目:asp.Net 来源:网络整理
导读:我在连接数据库服务器时遇到问题.数据库服务器不是本地的,我通过其IP地址连接. 它在我的开发机器上运行良好.将网站发布到我的服务器后,它无法连接到我的数据库服务器. A network-related or instance-specific error occurred while establishing a connecti
我在连接数据库服务器时遇到问题.数据库服务器不是本地的,我通过其IP地址连接.

它在我的开发机器上运行良好.将网站发布到我的服务器后,它无法连接到我的数据库服务器.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider,error: 40 – Could not open a connection to SQL Server)

为什么我的发布服务器无法连接到数据库服务器,而它可以通过开发机器正常工作?

解决方法

我经常遇到这个问题.主要是因为两个问题.

>打开SQL Server配置管理器.

>检查SQL Server网络配置是否支持TCP / IP,如果已禁用,则启用它.
例如SqlServer 2005网络配置,SQLEXPRESS的协议

>打开SQL Server Management Studio

>单击Sql Server属性(右键单击服务器名称和
选择属性).
>之后,选择“安全性”页面并将检查切换到“SQL Server和Windows身份验证模式”.

就这样.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读