G
Guest
VS2005 C# 2.0
I'm using ADO.NET and the Jet 4.0 OLE DB provider to append a row to an
Excel spreadsheet.
I have a data table of type System.Data.DataTable, and a table adapter of
type System.Data.OleDb.OleDbDataAdapter to fill the data table. These are
generated by the VS2005 dataset designer.
My connection string, created using the Data Links wizard is
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FootAnalNovel.xls;
Extended Properties="Excel 8.0;HDR=Yes";Persist Security Info=False
1. faAdapter.Fill() to fill the table from the worksheet
2. Create a new empty row for the table.
3. Set values for elements of the row.
4. Add the row to the table.
5. Call faAdapter.Update() to send results back to the spreadsheet
In the target spreadsheet I observe:
1. The row was added. The first column was autoincremented as desired.
2. All numeric columns in the sheet, including dates, are correct.
3. The header line has not been modified - that is correct.
4. All text columns in the table have been corrupted. But, in a very
particular way: they are filled in row by row by text that was originally in
the sheet, in the order that it appeared originally in the sheet. Both
originally empty cells and filled cells are overwritten.
Thanks in advance for your help.
Jim
I'm using ADO.NET and the Jet 4.0 OLE DB provider to append a row to an
Excel spreadsheet.
I have a data table of type System.Data.DataTable, and a table adapter of
type System.Data.OleDb.OleDbDataAdapter to fill the data table. These are
generated by the VS2005 dataset designer.
My connection string, created using the Data Links wizard is
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FootAnalNovel.xls;
Extended Properties="Excel 8.0;HDR=Yes";Persist Security Info=False
1. faAdapter.Fill() to fill the table from the worksheet
2. Create a new empty row for the table.
3. Set values for elements of the row.
4. Add the row to the table.
5. Call faAdapter.Update() to send results back to the spreadsheet
In the target spreadsheet I observe:
1. The row was added. The first column was autoincremented as desired.
2. All numeric columns in the sheet, including dates, are correct.
3. The header line has not been modified - that is correct.
4. All text columns in the table have been corrupted. But, in a very
particular way: they are filled in row by row by text that was originally in
the sheet, in the order that it appeared originally in the sheet. Both
originally empty cells and filled cells are overwritten.
Thanks in advance for your help.
Jim