连接字符串错误 [英] Connection String Error
问题描述
当我尝试创建与SqlDatabase的连接时。
然后我收到此错误:
建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)
连接字符串:
string str =Data Source = AJIT-PC / SQLEXPRESS; Initial Catalog = Employee; Integrated Security = True;
或者,我试图创建一个SqlExpress数据库(右边的App_Code文件夹和Addind SqlServer文件。
然后我得到了这个错误:
由于关闭而无法创建一个sql server实例连接
When I was trying to Create A Connection to SqlDatabase.
Then I got This 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)
And the connection String:
string str = "Data Source=AJIT-PC/SQLEXPRESS;Initial Catalog=Employee;Integrated Security=True";
Alternatively,I was trying To create a SqlExpress Data base (By right The App_Code Folder and Addind the SqlServer file.
and Then i got This error:
Failed to create a instance of sql server due to closed connection
推荐答案
你可以在这里找到问题的解决方案
http://stackoverflow.com/questions/18060667/cannot-connect-to-server-a-network-related - 或特定于实例的错误 [ ^ ]
you can find the solution of your problem here
http://stackoverflow.com/questions/18060667/cannot-connect-to-server-a-network-related-or-instance-specific-error[^]
这篇关于连接字符串错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!