Hi
I want to use code to import an Excel worksheet into an Access table.
I can easily fill a dataset from the Excel worksheet but I am having problem getting the data into Access.
I am using a DataAdapter update command (which I have used in other apps) but obviously the DataRowState for each row in the dataTable is Unchanged so no records are inserted.
I tried setting the DataRowState to Added but as I'm sure you know this is read only.
Next I tried looping through the rows in my original DataTable and adding them into a second DataSet and DataTable which I was going to use for my update but the error is 'This row already belongs to another table'.
Is there an easy way to do this or must I loop though each row putting each item seperately into a second datatable?
Thanks
redav
I want to use code to import an Excel worksheet into an Access table.
I can easily fill a dataset from the Excel worksheet but I am having problem getting the data into Access.
I am using a DataAdapter update command (which I have used in other apps) but obviously the DataRowState for each row in the dataTable is Unchanged so no records are inserted.
I tried setting the DataRowState to Added but as I'm sure you know this is read only.
Next I tried looping through the rows in my original DataTable and adding them into a second DataSet and DataTable which I was going to use for my update but the error is 'This row already belongs to another table'.
Is there an easy way to do this or must I loop though each row putting each item seperately into a second datatable?
Thanks
redav