(提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接)当我尝试使用不带密码的连接字符串连接到SQL Server 2000时,问题得到解决 [英] (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) is relaeased when i try to connect to a SQL server 2000 with a connection string without password

查看:209
本文介绍了(提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接)当我尝试使用不带密码的连接字符串连接到SQL Server 2000时,问题得到解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的应用程序创建一个测试连接模块,用于测试是否在使用用户名和密码的特定IP上找到服务器

我们的某些服务器没有密码,因此只是一个用户名

当我调用检查数据库连接的方法时,此异常被释放


建立与服务器的连接时发生错误.连接到SQL Server 2005时,此故障可能是由于以下事实导致的:在默认设置下,SQL Server不允许远程连接. (提供者:命名管道提供者,错误:40-无法打开与SQL Server的连接)


我不知道为什么它在连接到SQL Server 2000时为何包含SQL Server 2005

以及为什么我输入不带密码的连接字符串时它失败了,尽管它在查询分析器上连接了
连接字符串的示例
数据包大小= 4096;用户ID = sa;数据源= xxx.xxx.xxx.xxx;持久性安全信息=真实;密码=;初始目录= DebitCardIssuance"

我用来测试连接的功能


i want to make a test connection module for my application which test if the server is found on a particular IP with user name and password

some of our servers don''t have password so it is just a user name

when i call the method to check the database connection this exception is released


An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


i don''t know why it contain SQL Server 2005 while i''m connecting to SQL Server 2000

and why it fails when i enters a connection string with no password although it connects on the query analyzer
example of the connection string
"packet size=4096;user id=sa;data source=xxx.xxx.xxx.xxx;persist security info=True;password=;initial catalog=DebitCardIssuance"

the function i''m using to test the connection


SqlConnection conn = new SqlConnection(connectionString);
            try
            {
                conn.Open();
                return true;
            }catch(Exception e)
            {
                return false;
            }



请咨询



please advice

推荐答案

可能是外围应用配置错误或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.


这篇关于(提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接)当我尝试使用不带密码的连接字符串连接到SQL Server 2000时,问题得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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