Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel update

Status
Not open for further replies.

HrvojeVd

Programmer
Jun 22, 2008
36
0
0
HR
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();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top