本文介绍了错误:40 - 无法打开与SQL Server的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请解决我的问题
错误:
建立连接时发生网络相关或特定于实例的错误SQL Server。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)
我的电脑名称:bhargava-f794cb
Instace名称:MSSQLSERVER
什么是数据源名称
Hi,
Please solve my problem
Error:
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)
My pcname:bhargava-f794cb
Instace name:MSSQLSERVER
what is the datasource name
SqlConnection conn = new SqlConnection("Data Source=MSSQLSERVER;Initial Catalog=OnlineLibrary;Integrated Security=True");
推荐答案
SqlConnection conn = new SqlConnection("Data Source=bhargava-f794cb\SQLEXPRESS;Initial Catalog=OnlineLibrary;Integrated Security=True");
这篇关于错误:40 - 无法打开与SQL Server的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!