我用的是SQL Server2000,为什么会出现这个错误:
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。(provide:命名管道提供程序,error: 40-无法打开到SQL Server的连接)SqlConnection(Data Source =.; User ID=sa; Password=fjin; Initial Catalog = cztj; Integrated Security = true)大家帮帮忙吧。

解决方案 »

  1.   

    你这不是连接的2005吗,2005好像在默认情况下不允许sa登录,你需要用另一种方式打开管理器后,打开sa的权限
      

  2.   

    看看你sa的密码能进查询分析器不、 再连接server=.;database=db;uid=sa;pwd=0;
      

  3.   

    2000下连接字符串:
    <add name="e2state_RoleConnectionString" connectionString="Data Source=(local);Initial Catalog=user_role;Password=;User ID=sa;Max Pool Size=32767; Min Pool Size=0" providerName="System.Data.SqlClient"/>2005下连接字符串,你改成
    Data Source=localhost\SQLEXPRESS
      

  4.   

    你是写在程序里的嘛
    public static SqlConnection getSqlConnection()
        { return new SqlConnection("server=SDSERVER\\SD;database=e8;uid=sa;pwd=sd");
        }
    Web.config
    :<connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=SDSERVER\SD;Initial Catalog=DD2;User ID=sa;Password=sd8" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    server 写"." 不行,换ip本地 127.0.0.1 或者 sql服务器名称试试。
    在看看sql服务有没有开启,开启了,手动刷新。sa密码是不是对的。
      

  5.   

    机器上装的2000,但是装完VS2008好像自动装了个SQL Server 2005Express