0
Good afternoon, I am trying to update an excel spreadsheet but the command is not changing any value, it is only corrupting the spreadsheet.
I create the last two columns and rewrite the rest
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();
}
need to update all rows of the columns MODE and TIMES
– Gabriel Souza