I'm using excel file to get and save data.
This code is for update data , but in excel file I get a new record with this values instead of changed one by where clause.
code:
DataSet DS;
OleDbDataAdapter MyCommand;
OleDbConnection oledbConn = new OleDbConnection(connString);
oledbConn.Open();
// Write to Excel DB
OleDbCommand comm = new System.Data.OleDb.OleDbCommand("update [ankete$] set votes1 = " + r1v + ";" +
"set votes2 = " + r2v + ";" + "set votes3 = " + r3v + ";" + "set votes4 = " + r4v + ";" +
"WHERE id = 1", oledbConn);
comm.ExecuteNonQuery();
oledbConn.Close();
This code is for update data , but in excel file I get a new record with this values instead of changed one by where clause.
code:
DataSet DS;
OleDbDataAdapter MyCommand;
OleDbConnection oledbConn = new OleDbConnection(connString);
oledbConn.Open();
// Write to Excel DB
OleDbCommand comm = new System.Data.OleDb.OleDbCommand("update [ankete$] set votes1 = " + r1v + ";" +
"set votes2 = " + r2v + ";" + "set votes3 = " + r3v + ";" + "set votes4 = " + r4v + ";" +
"WHERE id = 1", oledbConn);
comm.ExecuteNonQuery();
oledbConn.Close();