为空有几种含意:
空字符串
Null空 属于不知道
应该改为:
//where jsgh = '" + aa[f] + "'; 就如同条件? 当等于什么的时候就修改什么
string sql = "upsate from t_teacher_card set kh =Null where jsgh = '" + aa[f] + "';
如果你的类型是varchar类型
--你双引号改成单引号即可!
--错误:string sql = "upsate from t_teacher_card set kh = "" where jsgh = '" + aa[f] + "';--正确:string sql = "upsate from t_teacher_card set kh = '' where jsgh = '" + aa[f] + "';
希望能帮到你!
C#中使用MySQL修改跟SQL中执行是一样的SQL语句
UPDATE tbName SET 列=null WHERE 条件
另外,C#中增加、删除、查询数据也是跟SQL Server中的SQL是一样的,只要SQL语句语法正确,就可以获得同样的效果
"upsate from t_teacher_card set kh = null where jsgh = '" + aa[f] + "'"
或者
"upsate from t_teacher_card set kh = '' where jsgh = '" + aa[f] + "'"
set fieldname = null