无法连接SQL Server [英] Unable to Connect SQL Server

查看:71
本文介绍了无法连接SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在ASP.Net上工作,并尝试连接到SQL Server 2005,但出现以下错误:

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

请告诉我解决方法.

谢谢,


Jhons

Hi,

I working on ASP.Net and try to connect to SQL Server 2005, but i am getting below 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)

Please tell me the solution.

Thanks,


Jhons

推荐答案

错误怎么说?您已采取什么措施来确保错误消息不正确?为什么您认为告诉我们错误会导致我们告诉您如何解决与您的代码和网络设置有关的问题,而您和您都没有共享这两个问题?
What does the error say ? What have you done to ensure that the error message is not correct ? Why do you think that telling us the error will result in us telling you how to fix a problem that relates to your code and your network setup, neither of which you have shared ?


正在将连接写入web.config文件中.那么您可能已经错过了PROVIDERNAME ="System.Data.SqlClient"

if you are writing the connection in web.config file. Then you might have missed the PROVIDERNAME="System.Data.SqlClient"

<connectionStrings>
        <add name="NorthConnection" connectionString="server=10.0.3.41;uid=sa;pwd=change_123;database=Northwind" providerName ="System.Data.SqlClient"/>
        
    </connectionStrings>


可能是外围应用配置错误或sql服务配置问题.请查看此线程的潜在原因和解决方法: ^ ]

如果需要,请在此处参见设置外围应用配置的步骤. .

如果这不能解决您的问题,请查看以下线程:
http://forums.asp.net/t/1334649.aspx [ SQL服务器修复错误(提供者:命名管道 [
It might be surface area configuration error or sql service configuration issue. Have a look at this thread for potential reasons and resolutions: Resolving A network-related or instance-specific error occurred while establishing a connection to SQL Server[^]

If needed, See steps for setting up Surface area configuration here..

If this does not resolve your issue, have a look at these thread:
http://forums.asp.net/t/1334649.aspx[^]
SQL SERVER FIX ERROR (provider: Named Pipes [^]
Quite few possible reasons and resolutions are proposed here too.


这篇关于无法连接SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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