大家帮我看看,这是怎么回事,
string id = e.Item.Cells[0].Text;//非编辑状况
string username=((TextBox)(e.Item.Cells[1].Controls[0])).Text;
string cardid = ((TextBox)(e.Item.Cells[2].Controls[0])).Text;
string workername = ((TextBox)(e.Item.Cells[3].Controls[0])).Text;
string sex=((TextBox)(e.Item.Cells[4].Controls[0])).Text;
string huji = ((TextBox)(e.Item.Cells[5].Controls[0])).Text;
string birthdate=((TextBox)(e.Item.Cells[6].Controls[0])).Text;
string duty=((TextBox)(e.Item.Cells[7].Controls[0])).Text;
string comdate=((TextBox)(e.Item.Cells[8].Controls[0])).Text;
SqlConnection con = db.createconnection();
con.Open();
SqlCommand cmd = new SqlCommand( "update worker set username='" + username + "',cardid='"+cardid+"',workername='" + workername + "',sex='" + sex + "',huji='" + huji + "',birdate='" + birthdate + "',duty='" + duty + "',comdate='" + comdate + "' where id='"+id+"'",con);
cmd.ExecuteNonQuery();
为什么这个语句更新运行没有错误,却没有效..
[求助]asp.net中更新不了是怎么回事?