Saturday, March 28, 2015

How do I write to specific cells in Excel? ... C#, OleDb

The UPDATE statement is missing single quotes around the value. This should work:



string sql = "UPDATE [" + stSheetName + "$B2:B2] SET F1='e'";

If the INSERT statement does not work unless you specify the name of the columns, then use the UPDATE statement or give the column names.


Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.


No comments:

Post a Comment