"Data Source=.\\SQLEXPRESS;Initial Catalog=Student表;Persist Security Info=True;User ID=GAOMING;Password=xinyisi;" + "providerName=System.Data.SqlClient"
好象是少了个分号

解决方案 »

  1.   

    Persist Security Info=True;
    去掉这个,这个表示用windows集成登陆,你指定用户名,就不能用这个。
      

  2.   

    #2老兄能帮我解释一下那些关键字都是啥意思嘛,谢谢,第一次用sql2005
      

  3.   

    打开SQL Server Management Studio Express,
    右键点击服务器,选择Properties(属性),在弹出窗口中点击Security(安全)切换到安全面板,
    将server authentication服务器认证从windows authentication mode(windows用户认证模式)
    修改为Sql Server and Windows Authentication mode(Sql server和windows认证模式),ok。
    打开security(安全性) -- logins(登录名) ,右键选中GAOMING,选择properties(属性),点击Status(状态)切换到状态面板,将Login(登录)设置为Enabled(启用)。
      

  4.   

    public static string connString =" Persist Security Info=False;Integrated Security=true;Initial Catalog=Student表.mdf;Server=127.0.0.1";我又从新修改了,还是不行,提示说该用户无法连接
      

  5.   

    新建一个空的txt文件,把扩展名改为UDL,双击,连接成功后确定,把扩展名改回txt,从里面复制.
    看看里面怎么写的就知道怎么用了
      

  6.   

    public static string connString = "Data Source=.\\SQLEXPRESS;Initial Catalog=Student表;Persist Security Info=True;User ID=GAOMING;Password=xinyisi" + "providerName=System.Data.SqlClient";
    看你的一大堆
    这样该
    public static string connString = "server=.\\SQLEXPRESS;database=Student;uid=sa;pwd=ok;"
    + "providerName=System.Data.SqlClient";
    用sa登录啊!