Q: Copying a table from one database to another

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
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
 
Geoff,

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

Cor
 
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"
 
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"
...
 
Back
Top