string s="data source=127.0.0.1;initial catalog=PDMS_CT;Connect Timeout=30"
SqlConnection conn = new SqlConnection(s.ToString());在页面上点击连接数据库是,会报这样的错
Exception Details: System.Data.SqlClient.SqlException: Login failed for user sssx-APPL\ASPNET'.

解决方案 »

  1.   

    从前不怎么用SqlServer,我没有建立用户和密码,为什么还会报这样的错
      

  2.   

    string s="data source=127.0.0.1;initial catalog=PDMS_CT;Connect Timeout=30;UId=sa;Pwd=;"
    try~~~```````
    不知道你的sql server 的密码是什么~~`
      

  3.   

    我的数据库SA的密码是系统默认的,如果我重新修改,它总提示
    SQL Server registration failed because of the connection failure displayed below. Do you wish to Register anyway?
    Login failed for user 'sa'. Reaon: Not associated with a trusted SQL Server connection.
    -------
    我自己新建了一个用户ABC,密码ABC.
    但联数据库时它总是提示
    Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'abc'. Reason: Not associated with a trusted SQL Server connection
    真不知道该怎么解决了!
      

  4.   

    string s="data source=127.0.0.1;initial catalog=SSPI;Connect Timeout=30;database="数据库名称""
    SqlConnection conn = new SqlConnection(s);
      

  5.   

    试下这个string conStr=@"Server=127.0.0.1;Integrated Security=SSPI;Connect Timeout=30;database="数据库"";
    SqlConnect conn =new SqlConnection(conStr);
      

  6.   

    www.yoxun.com/sym/conn.htm
    各种连接数据库的方法大全,看看吧