解决方案 »

  1.   

    1. 类似这种写法txname.Text,其实不太好的, 防止后面有空格的情况。最好 这样 txname.Text.Trim()
    2. 你的语句没执行成功八成 是 被  where 条件 里面过滤掉 了。更新最好你where 里面 用那一条信息唯一ID。 where id=1  类似这样 
      

  2.   

    楼主要更新哪笔数据啊?都没有where语句定位
    你那样是全部记录都更新了啊
      

  3.   

     sql.Append("update student set name = '" + txname.Text + "',sex = '" + txsex.Text + "',phone = '" + txphone.Text + "',address = '" + txaddr.Text + "',qq = '" + txqq.Text + "'where name = '" + txname.Text + "' and sex = '" + txsex.Text + "' and phone = '" + txphone.Text + "' and address = '" + txaddr.Text + "' and qq = '" + txqq.Text + "'"); 設置斷點,查看sql語句是否正確。
    1,where前要空一個格,否則sql語法錯誤。
    2,更新的內容和條件一樣,也就相當於沒有進行過更新操作。
      

  4.   

    首先select定位需修改的记录,再改写为update