String strConnection="server=IP地址;database=ThePhile;uid=sa;pwd=19;";

解决方案 »

  1.   

    在Sqlserver2k 中的安全 里加上 asp。net 用户
      

  2.   

    String strConnection="server=mydb;database=Northwind;integrated security=true;";
    问题就出在这里//SQL Server 不存在或访问被拒绝。String strConnection="server=计算机名或IP地址;DataBase=数据库名;uid=用户名;pwd=密码"
    一般SQLserver默认用户名为sa;pwd为空
    String strConnection="server=127.0.0.1;database=Northwind;uid=sa;pwd=;";
      

  3.   

    呵呵昨天我也遇到,不過查出來了,是邊接字符串的問題.
    string cnstr="server=localhost;uid=sa;pwd=sa;database=pubs;"
      

  4.   

    SQL Server 安装用混合模式。
    不要用在装的时候选本地系统用户登陆。
    String strConnection="server=IP地址;database=ThePhile;uid=sa;pwd=";
      

  5.   

    谢谢大家呀,可是我按这个输入:
    String strConnection="server=mydb;database=Northwind;uid=sa;pwd=;";系统提示:用户 'sa' 登录失败。原因: 未与信任 SQL Server 连接相关联。 
    这怎么解决!感谢了。
      

  6.   

    那你的Sql Server 的登陆帐号和密码改过了吗?
      

  7.   

    sql server登陆帐号和密码没有改呀!
      

  8.   

    有两种情况:
    都是数据库连接没成功。
    1、是你的SQL server数据库用户名你更改过,这种情况你在“安全性”里---“登录”---把用户名为sa的密码更改为空。就可以了。
    2、data source=localhost;initial catalog=数据库名;password=;persist security info=True;user id=sa;就可以联结了。