`
lipan61
  • 浏览: 45938 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Named Pipes Provider, error: 40 - Could not open a

阅读更多

如果用SQLServer的SQLEXPRESS版本的话,连接时经常回遇到这个问题,查了很多终于找到了解决方法。

The typical error when dealing with Express includes:

a. User is not aware of SqlExpress was installed as a named instance, consequently, in his/her connection string, he/she only specify ".","localhost" etc instead of ".\SqlExpress" or "\Sqlexpress".

b. Np was disabld by default after installing SqlExpress.

c. If Sqlexpress was installed on the remote box, you need to enable remote connection for Express.

其中a的.\SqlExpress必须写在web.config文件中,如:

<connectionStrings>
<add name="NorthwindConnectionString" connectionString="Data Source=.\SqlExpress;Initial Catalog=Northwind;User ID=sa;Password=test"
   providerName="System.Data.SqlClient" />
</connectionStrings>

再用ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString把connectionStrings从应用程序中读出来。如果直接把.\SqlExpress写在应用程序中如:SqlConnection conn = new SqlConnection("data source=.\ SqlExpress;initial catalog=Northwind;user id=sa;password=test")这样也是有错误的!

Please read the following blog for best practice of connecting to SqlExpress.

http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

分享到:
评论
1 楼 figure_he_he 2010-07-26  
谢谢提供的方法、

相关推荐

    error:40-无法打开到SQL server的连接

    (provider:命名管道提供程序,error:40-无法打开到SQL server的连接) 处理:1、在配置工具-&gt;Sql server 外围应用配置器-&gt;服务器和连接的外围应用配置器-Sql2005-&gt;Database Engine-&gt;远程连接-&gt;同时使用TCP/IP和...

    sql错误解决错误号:40error: 40

    错误现象 无法连接到 .。在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误... (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) (.Net SqlClient Data Provider) 很详细的过程。

    SQL Server 出现Error: 1326错误(管理器无法连接远程数据库)问题解决方案

    SQL Server 出现Error: 1326错误 我们在在使用SQL Server时都会遇到使用SQL ...(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5) An e

    SQL_Server_2008登录问题(错误_233和18456)解决方法

    这种错误通常是由于 Named Pipes 和 TCP/IP 协议未启用所致。解决方法是: 1. 打开 SQL Server 配置管理器,在弹出的窗体中,找到“SQL Server 2008 网络配置”。 2. 把“MSSQLSERVER 的协议”下的“Named Pipes”...

    named pipe

    Named pipes can be used to provide communication between processes on the same computer or between processes on different computers across a network. If the server service is running, all named pipes ...

    DIN 8061:2009-10

    ### DIN 8061:2009-10: Unplasticized Polyvinyl Chloride (PVC-U) Pipes – General Quality Requirements and Testing #### 标准概述 DIN 8061:2009-10 是一项德国标准(Deutsche Industrienorm),规定了未塑化...

    SQLServer2005数据库技术与应用大学教案2SQLServer2005的安装与配置

    资源名称:SQL Server 2005数据库技术与应用 大学教案2 SQL Server 2005的安装与配置资源截图: 资源太大,传百度网盘了,链接在附件中,有需要的同学自取。

    named-pipes:Windows 命名管道作为节点的事件发射器

    NamedPipes = require ' named-pipes ' server = NamedPipes . listen ( ' your-pipe-name ' ) server . on ' connect ' , ( client ) -&gt; console . log ' New Client ' client . send ' welcome ' , ' something...

    unix-pipes:Common Lisp中的Unix管道

    :unix-pipes 常见的Lisp Unix管道作为流。 目前这仅适用于Linux。 我写这篇文章是因为在使用外部程序运行程序时我想要内存中的流,并且发现flexi-stream无法正常工作。 这就导致了关于阅读流的困惑,然后我就结束...

    pipes-rt:一些管道以定时模式产生值

    λ: import Pipes λ: import qualified Pipes.Prelude as PP λ: import Pipes.RealTime λ: import Data.Time λ: import Data.Time.Clock λ: -- Pass values at 2 Hz λ: runEffect $ each [1..4] &gt;-&gt; ...

    rocket-pipes:强大的TypeScript管道,为您链接Promise和ADT:bus:->:mountain:->:mountain_cableway:->:snowboarder:->:rocket:

    火箭管 功能强大的TypeScript管道,可以像流行的FP库中的Maybe或Either一样链接Promise和ADT。 特征 :candy: 糖管。 不用担心诺言或ADT本身。 直接使用已解析的值。 :light_bulb: 类型推断。 无需担心手动键入工作...

    pipes-sqlite-simple:将Pipe和sqlite-smash在一起的函数

    粉碎Pipes,Pipes.Safe和sqlite-simple的功能 用法 &gt; import Pipes.SQLite &gt; import qualified Pipes as P &gt; import qualified Pipes.Prelude as P &gt; import Pipes.Safe &gt; import qualified Database.SQLite.Simple...

    解决SQLServer管理器无法连接远程数据库的问题

    (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)** 2. **An error has occurred while establishing a connection to the server. ...

    CDH环境搭建步骤及如何使用C++进行开发

    2. 安装系统并分配合适的磁盘空间,如根目录100G和交换分区40G。 3. 使用fdisk进行逻辑盘分区。 4. 格式化逻辑分区为ext4文件系统。 5. 在/mnt下创建目录并挂载新分区。 6. 编辑/etc/fstab添加挂载信息。 7. 可选:...

    Hips Attention

    Named pipes are inter-process communication mechanisms that allow processes to communicate over a network or within the same machine. Monitoring this path is essential for detecting any unauthorized ...

    SQL Server 2008网络协议深入理解

    Named Pipes和Virtual Interface Adapter(VIA)。代开SQL Server配置管理器之后,会显示一个配置SQL Server服务,SQL Server网络协议和SQL Native Client协议的节点。可以通过展开SQL Server 2008网络配置节点进行...

    flux-pipes-fs:用于通量管道的 NodeJS fs 包装器

    为了解决这个问题,"flux-pipes-fs" 库被创建出来,它是一个针对 Node.js fs 模块的包装器,专门设计用于在通量管道中高效地操作文件。 **通量管道(Flux Pipes)概念** 通量管道是一种编程模式,它允许开发者将一...

    Microsoft SQL 2007年认证试题(英文PDF版)

    - **Named Pipes:** This is a network protocol that allows for direct communication between processes running on different machines. It is often used in LAN environments where fast and reliable ...

    pipes-rs:在Rust中对pipes.sh进行过度设计的重写

    管道 在Rust中对pipes.sh进行过度设计的重写 ...可以使用位于~/.config/pipes-rs/config.toml TOML来配置pipe ~/.config/pipes-rs/config.toml 。 以下是具有默认设置的示例文件: bold = true color_mode = " ansi

    PyPI 官网下载 | simple_pipes-0.1.0-py3-none-any.whl

    资源来自pypi官网。 资源全名:simple_pipes-0.1.0-py3-none-any.whl

Global site tag (gtag.js) - Google Analytics