INSERT INTO 语句的语法错误

时间:2022-07-21 15:07:51

string sqlstr ="insert into db_New(content,title,classname,username,headline,highlight,summary,Nkey,writer,source,hints,dateandtime,popedom,checkup,Image,ImagePosition,ImageSize,blImage) values('" + content + "','"
     + title + "','"
     + classname + "','"
     + username  + "',"
     + hl  + ","
     + HL + ",'"
     + summary   + "','"
     + nk      + "','"
     + at    + "','"
     + sr    + "',0,now,'"
     + popedom   + "',"
     //+ checkup   + ")";
     //图片相关信息
     + checkup + ",'"
     + imageUpload + "','"
     + imagePosition + "','"
     + imageSize + "',"
     + blimageNew + ")";

解释:sql语句在access库中执行正确,没有任何问题,数据权限也没有问题,但是.net执行就总是出现以上错误

原因:
字段名Image与.net 的保留字冲突了。