/*connection ,command, and link between connection & command objects are done properly and they are working*/
cmd.CommandText = "Update student SET sname='"+snaame+"',fee='"+fees+"' where sno='"+snum+"'";
cmd.Parameters.Clear();
cmd.CommandType = CommandType.Text;
con.Open();
cmd.ExecuteReader();
con.Close();
答案 0 :(得分:0)
检查数据库中fee
和sno
的数据类型,如果是varchar
,那么请删除它周围的单引号
fee='"+fees+"' where sno='"+snum+"'"