执行程序时出错 [英] error while execute the programme

查看:106
本文介绍了执行程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)

解决方案

您好,



看看这里:

http://social.msdn.microsoft.com/Forums/sqlserver/ EN-US / 0628296e-939A-4700-b498-1c3c9ce90597 / A-networkrelated或 - instancespecific-错误出现,而确立,一个连接到SQL服务器?论坛= sqlsecurity [<一个HREF =http://social.msdn.microsoft.com/Forums/sqlserver/en-US/0628296e-939a-4700-b498-1c3c9ce90597/a-networkrelated-or-instancespecific-error-occurred-while-establishing-a -connection-to-sql-server?forum = sqlsecuritytarget =_ blanktitle =New Window> ^ ]

http://stackoverflow.com/questions/16256533/a-network-related-or-instance-specific-error-occurred-while-establishing-a-conne [ ^ ]

http://stackoverflow.com/questions/15924877/error-occurred-while-establishing-a-connection-to-sql-server [ ^ ]


< blockquote>通过检查你的连接字符串开始 - 它需要是正确的。

然后检查远程SQL服务器计算机是否已启动,工作,并通过网络可用于运行该软件的计算机。



如果这一切都很好,那么它将取决于这是你的开发系统还是生产。

开发:尝试在VS中使用Server Explorer窗格建立连接:

1)打开服务器资源管理器。

2)右键单击数据连接并选择添加连接

3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接按钮。

4)连接工作时,按确定

5 )在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。



对于生产,您需要做同样的事情 - 但是你不会安装VS,所以在SQL服务器上寻找SSMS的副本并尝试类似的东西,或者向DBAdmin询问你需要的详细信息。


基本上,当您无法连接到SQL Server时,问题可能是:

1)网络问题,

2)SQL Server配置问题。

3)防火墙问题,

4)客户端驱动问题,
5)应用程序配置问题。

6)身份验证和登录问题。

检查这些

解决SQL连接问题的步骤 [ ^ ]

SQL Server 2005连接问题疑难解答 - 第一部分 [ ^ ]

解决SQL Server 2005中的连接问题 - 第二部分 [ ^ ]

解决SQL Server 2005中的连接问题 - 第III部分 [ ^ ]


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)

解决方案

Hi,

Have a look here:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/0628296e-939a-4700-b498-1c3c9ce90597/a-networkrelated-or-instancespecific-error-occurred-while-establishing-a-connection-to-sql-server?forum=sqlsecurity[^]
http://stackoverflow.com/questions/16256533/a-network-related-or-instance-specific-error-occurred-while-establishing-a-conne[^]
http://stackoverflow.com/questions/15924877/error-occurred-while-establishing-a-connection-to-sql-server[^]


Start off by checking your connections string - it need to be correct.
Then check that the remote SQL server computer is powered on, working, and available via teh network to the computer running the software.

If that's all good, then it is going to depend on whether this is your development system or production.
For development: Try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.

For production you need to do much the same thing - but you won't have VS installed, so look for a copy of SSMS on the SQL server and try something similar, or ask your DBAdmin for the details you need.


Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.

Check these
Steps to troubleshoot SQL connectivity issues[^]
SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^]


这篇关于执行程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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