Good afternoon, I'm trying to update an excel worksheet but the command is not changing any values, it's just corrupting the worksheet.
I create the last two columns and rewrite the other
connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + saveLocation + "; Extended Properties='Excel 12.0;HDR=YES'";
connection.Open();
string sSql = "Create Table [" + lStrNome_Table_Planilha + "] (PROCESSO Int, ANO Int, MÊS Int, ID Int, VERBA Int, QTDE Int, VALOR Int, LOTE Int, MODO Int, VEZES Int)";
using (OleDbCommand oCmd = new OleDbCommand(sSql, connection))
{
oCmd.ExecuteNonQuery();
}
sSql = "Update [" + lStrNome_Table_Planilha + "] set MODO = 1";
using (OleDbCommand oCmd = new OleDbCommand(sSql, connection))
{
oCmd.ExecuteNonQuery();
}