oledb命令excel插入语法错误

本文关键字:语法 错误 插入 excel 命令 oledb | 更新日期: 2023-09-27 18:12:20

   string strSQL = "INSERT INTO " + firstSheetName + "(Date, Market, Source, Commodity, Frequency, Price, Report_Type, MISC, Breeds, Age_Group, Gender, Grade) VALUES ('Beth', 'Hart','Beth', 'Hart','Beth', 'Hart','Beth', 'Hart','Beth', 'Hart','Beth')";
 OleDbCommand OleDbCommand = new OleDbCommand(strSQL, oconn);
   OleDbCommand.ExecuteNonQuery();

oledb命令excel插入语法错误

"INSERT INTO " + firstSheetName + "(Date,

后面需要一个空格

"INSERT INTO " + firstSheetName + " (Date,

我注意到的另一件事是,您有12列值,只有11个数据值。您需要添加第12个数据值。