获取错误:建立与SQL Server的连接时发生与网络相关或特定于实例的错误 [英] Getting error: A network-related or instance-specific error occurred while establishing a connection to SQL Server
问题描述
我是新手开发人员.尝试从计算机到服务器计算机连接到SQL Server时遇到问题.
I'm newbie developer. I have a problem trying to connect to SQL Server from my computer to server machine.
建立与SQL Server的连接时发生与网络相关或特定于实例的错误.
服务器未找到或无法访问.验证实例名称正确,并且已将SQL Server配置为允许远程连接.(提供者:SQL网络接口,错误:26-指定服务器/实例时出错)
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
我已经搜索了发布它的方法,并且找到了许多解决方案.但是没有人为我工作.你能帮我吗?
I've searched the way to issue it and I'm found many solution. But none are working for me. Could you please help me?
这是我的连接字符串
string constring = @"Data Source=137.xx.xx.xxx\\SQLEXPRESS;Initial Catalog=EDI_HR;User ID=sa;Password=1234;";
和
string constring = @"Data Source=CISXXXXXX\SQLEXPRESS;Initial Catalog=EDI_HR;User ID=sa;Password=1234;";
最后,这些是对我不起作用的解决方案的一些参考:
Finally, those are some of the references of a solution that don't work for me:
- https://www.lansweeper.com/kb/174/a-network-related-or-instance-specific-error-occurred.html
- https://support.solarwind_ance_Form_Center(Success/Exception_A_network_related_or_instance_specific_error_while_ Establishment_a_connection_to_SQL_Server
- 为什么我是否收到无法连接到服务器-与网络有关或与实例有关的错误"?
- 为什么建立与SQL Server的连接时发生与网络相关或特定于实例的错误?
推荐答案
尝试一下:
string constring = @"Data Source=137.xx.xx.xxx\\SQLEXPRESS;Initial Catalog=EDI_HR;Integrated Security =True";
这篇关于获取错误:建立与SQL Server的连接时发生与网络相关或特定于实例的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!