copying datatable data into MS Access table

V

VMI

How can I dump a datatable into an Access table (which contais exactly the
same structure)?
Somebody suggested doing this with a dataAdapter. I don't want to run an
Insert query for each record (I assume that if the datatable and the Access
table have the same structure, I can just dump it from one place to the
other). I'd be dumping data to the same Access table several times (append).
The solution would be like a reverse DataAdapter.Fill().

Thanks.
 
M

Mohamoss

HI
You can sill use dataadapter . used a typed dataset ( build its relational
structure to match the table of your source and the relational model of you
access table ) then use the fill of the data adapter to fill this dataset
. after that you can close the adapter ( but you still have the dataset
filled in memory with data) . then create a new adapter that is associated
with the empty Access database . and since you have the dataset filled with
data( and match the same structure as your access table ) the you can
associate it again with the new adapter and use the update command now to
fill back the data into your access table .

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top