添加
sqldataadapter.update(dataSet11.Tables["用户"])

解决方案 »

  1.   

    触发这个事件了吗Linkbutton1_Click
      

  2.   

    public string TeacherLogin(string strUserName, string strPassword)
    {  
    string  strMessage="";
    SqlConnection sqlConnection = new SqlConnection(m_strConnection);
    string strSQL="select zt from jcjsqd where yhm='"+strUserName+"' and mm='"+strPassword+"'";
    SqlCommand sqlComm = new SqlCommand(strSQL, sqlConnection);
    SqlDataReader sqlRead=null;
    sqlConnection.Open();
    sqlRead=sqlComm.ExecuteReader ();
    if (sqlRead.Read() ==true)
    {
    if (sqlRead["zt"].ToString ()=="1")
    {
    strMessage="OK";
    }
    else if (sqlRead["zt"].ToString ()=="0")
    {
    strMessage="该用户还没有通过验证,请以匿名方式登录!";
    }
    else if (sqlRead["zt"].ToString ()=="2")
    {
    strMessage="该用户已经被暂停使用!";
    }
    }
    else 
    {
    strMessage="用户名和密码不符!";
    }
    sqlRead.Close();
    sqlConnection.Close();
    return (string)strMessage;
    }
    这是我写的一个用户登陆验证的你可以看一看。