我想使用 oledb 更新 excel 文件的特定单元格。说 I7 单元,由于某种原因,I1 总是在更新。谁能告诉我这段代码有什么问题?
OleDbConnection oledbConn = new OleDbConnection(connString);
oledbConn.Open();
// I want to set the value of I7 cell to 22, for some reason value is I1 is getting updated :(
OleDbCommand cmd = new OleDbCommand("UPDATE [" + sheetName + "$I7:I7] SET F1=22", oledbConn);
int result = cmd.ExecuteNonQuery();
Console.WriteLine(result);
oledbConn.Close();