H
headware
I'm writing code to copy the rows of a certain table in one database
to a table of the same structure in another database. I loop through
the rows in the source table and add them to a DataTable object
representing the destination table. Then I use the OleDbCommandBuilder
and the OleDbDataAdapter.Update() method to write the changes to the
destination database.
The problem is that the primary key of the table is an AutoNumber
field and the values in the source table aren't being copied over into
the destination table. ADO.NET seems to allow Access to specify it's
own values instead of using the currently existing ones. I can get it
to work using an INSERT statement and the OleDbCommand class, but I'd
rather use the Update() method for various reasons. How can I tell
ADO.NET to use the AutoNumber values in the source table?
Thanks,
Dave
to a table of the same structure in another database. I loop through
the rows in the source table and add them to a DataTable object
representing the destination table. Then I use the OleDbCommandBuilder
and the OleDbDataAdapter.Update() method to write the changes to the
destination database.
The problem is that the primary key of the table is an AutoNumber
field and the values in the source table aren't being copied over into
the destination table. ADO.NET seems to allow Access to specify it's
own values instead of using the currently existing ones. I can get it
to work using an INSERT statement and the OleDbCommand class, but I'd
rather use the Update() method for various reasons. How can I tell
ADO.NET to use the AutoNumber values in the source table?
Thanks,
Dave