zoukankan      html  css  js  c++  java
  • 数据库连接字符串的一个问题

    错误信息:

    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)

    检查后发现是webconfig的配置问题,将

    <add key="ConnectionString" value="Data Source=(local);Initial Catalog=my51aspx;User ID=sa;Password=sa;"/>,

    改成本地计算机名

    <add key="ConnectionString" value="Data Source=(liuranjun\data);Initial Catalog=my51aspx;User ID=sa;Password=sa;"/>,

    问题解决。

    在SQL   里:

    Server=(local);   用的是named   pipes   通讯.

    Server=localhost;   用的是从   port   1434   udp协商来的端口,缺省是1433的口上进行TCP通讯.

    我听人说过,Server=localhost在XP   Service   Pack   2   以前还工作,到了XP   SP2就不工作了.  

    MS建议用server=计算机名,不用Server=localhost

  • 相关阅读:
    js学习之函数
    面试题
    渐进增强(progressive enhancement)、优雅降级(graceful degradation)
    倒计时
    css 平行四边形
    网址URL分解
    图片延时加载
    获取元素的宽高,左边距上边距
    电商平台放大镜效果
    js笔记
  • 原文地址:https://www.cnblogs.com/icebutterfly/p/1368380.html
Copyright © 2011-2022 走看看