Q: Copying a table from one database to another

G

Geoff Jones

Hi

Can anybody tell me the easiest way in ADO.NET to copy a table from one
Access database to another Access Database?

Some example code would be useful.

Thanks in advance

Geoff
 
C

Cor Ligthert

Geoff,

The content or the complete table including the schema (what is not direct
possible)

Cor
 
G

Geoff Jones

Hi Cor

The content; although wouldn't this implicitly include the schema as well?
That is, I want to make an exact copy of the table in the other database
file.

Geoff

P.S. I don't understand what you mean by "what is not direct possible"
 
C

Cor Ligthert

Geoff,

It is not directly possible to create a database table from a dataset. You
can of course try to create your own routine, for building a SQL Create
string using the schema in the dataset.

And than when you have it and made generic, send it to this newsgroup,
because there is often asked for.

You can copy a datatable by setting first when you do the fill the option
with the dataadapter the acceptchangesduringfill to false

http://msdn.microsoft.com/library/d...aadapterclassacceptchangesduringfilltopic.asp

Than you can update it to an other database with the same (or almost same)
schema.

When you want to use the commandbuilder you can use the fillschema first.

I hope this gives some ideas

Cor

"Geoff Jones"
...
 

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