条件表达式中的数据类型不匹配。在c#中

时间:2014-04-05 11:02:17

标签: .net

/*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();

1 个答案:

答案 0 :(得分:0)

检查数据库中feesno的数据类型,如果是varchar,那么请删除它周围的单引号

fee='"+fees+"' where sno='"+snum+"'"