无法连接到服务器 - 与网络相关或特定于实例的错误 [英] Cannot connect to server - a network related or instance specific error

查看:100
本文介绍了无法连接到服务器 - 与网络相关或特定于实例的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我做了一个包含SQL Server数据库的简单应用程序。应用程序在我的电脑上完美运行,但是,当我在另一台PC上复制项目并尝试运行应用程序时,出现错误:



Hi. I have made a simple app that includes SQL Server database. App is working perfectly on my PC, but ,when I copy project on another PC and try to run the app, the error comes up:

Cannot connect to 108.163.224.173.

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) (Microsoft SQL Server, Error: 1326)





这是我的连接字符串:





This is my connection string:

private string connString = @"Data Source=JOHN-PC\SQLEXPRESS;Initial Catalog=ProfessorDatabase;Integrated Security=True;Pooling=False";







这让我发疯了。



我尝试了什么:



到目前为止,我尝试为我的服务器名称启用TCP / IP,I在两台PC上的防火墙中添加了入站和出站规则。请帮帮我。




This is driving me crazy.

What I have tried:

So far I tried enabling TCP/IP for my server name,I added inbound and outbound rules in Firewall on both PCs. Please help me.

推荐答案

你还记得在连接中添加实例名吗???

Did you remember to add the instance name also in the connection ???
localhost\SQLExpress

108.163.224.173\SQLExpress



和是检查防火墙设置或关闭它测试目的。


and yes check the firewall settings or turn it off for testing purpose.


这篇关于无法连接到服务器 - 与网络相关或特定于实例的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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