Oledbdataadapter not updating

Thanks for your replay i have tried but some error is comeing ,i have written as fallows, String s Connection String = "Provider=Microsoft. OLEDB.4.0;" "Data Source=" path ";" "Extended Properties='Excel 8.0; HDR=NO'"; Ole Db Connection obj Conn = new Ole Db Connection(s Connection String); obj Conn. OLEDB.4.0; Data Source=C:\Temp\Book1.xls; Extended Properties='Excel 8.0; HDR=NO'"; Ole Db Connection obj Conn = new Ole Db Connection(s Connection String); obj Conn. OLEDB.4.0; Data Source=C:\Temp\Book1.xls; Extended Properties='Excel 8.0; HDR=NO'"; Ole Db Connection obj Conn = new Ole Db Connection(s Connection String); obj Conn.

Open(); Ole Db Command obj Cmd Select = new Ole Db Command("UPDATE [Sheet1$A2: A2] SET F1='Test Value1'", obj Conn); obj Cmd Select. Close(); the error is="No value given for one or more required parameters." here i am not getting where is the error plz help me ,plz give me some codes to do update a single cell of excel sheet. Open(); Ole Db Command obj Cmd Select = new Ole Db Command("UPDATE [Sheet1$A2: A2] SET F1=123456", obj Conn); obj Cmd Select. Close(); Thanks for ur reply, this code is working fine but only for the f1 column but i want to change cell value of f12 or f13 then this gives same error that i have posted before, plz give me the command for updateing f12 or f13 cell of the excel file. Open(); Ole Db Command obj Cmd Select = new Ole Db Command("UPDATE [Sheet1$A2: A2] SET F1=123456", obj Conn); obj Cmd Select.

UPDATE [Sheet1$B10: B10] SET F1=123 UPDATE [Sheet1$B11: B11] SET F1=456 UPDATE [Sheet1$B12: B12] SET F1=789 This will update cell B1 three times and the final result is 789 in cell B1 even though I wanted to update B10, B11, B12.

F1 is just the first cell in your destination range...

Hi, I'm trying to update excel 2007 (*.xlsx) using the statement below "UPDATE [Sheet1$A5: A5] set F1=999" The issue now, it always updated the first row, in this case is A1.

So with this example you can use F2: You obviously could have done this with two update statements as well, but this would be more performant.

Remember that the automatic naming of columns (F1, F2, F3,...) has nothing to do with the Excel cells F1, F2, F3.

Leave a Reply