SqlDataAdapter是填充数据用的SqlCommand  cmd=new SqlCommand("Updatestring",SqlConnection);
cmd.ExecuteNoneQuery();

解决方案 »

  1.   

     protected void btnCommit_Click(object sender, EventArgs e)
        {     
            string strSQL = "update TA_成绩表 set 期中成绩='" + txtMid.Text + "',期末成绩='" + txtEnd.Text + "',平时成绩='" + txtDairly.Text
                + "' ,总成绩='" + txtSum.Text + "' ,录入标志='是' where (课程号='" + Session["coursevalue"] + "') and (学号='" + Session["sno"] + "')";
            SqlConnection conn = new SqlConnection(strConn);
            conn.Open();
            SqlCommand cmd = new SqlCommand(strSQL, conn);
            cmd.ExecuteNonQuery();
            conn.Close();
        }
    我改成这样了,还是不能插进表中
      

  2.   

    前面问题解决了。还有一个问题,GridView里面添加一列操作列后,如何通过操作列里的按钮获得该行的某一个值?