Transfer data from a SQL CE database to another one

G

Gianco

Hello, I have the following problem:

I have a database A that contains some data I would transfer in the
database B. The two databases have the same structure (tables,
fields...). I would use a query with a statement similar to:

INSERTO INTO B.TABLE_X (SELECT * FROM A.TABLE_X)

But is this possible with SQL CE? The queries are related to a
connection, and a connection is related to a single database

Is there another way to do it?

Thanks in advance
Gianco
 
D

Darren Shaffer

Open a connection to database A and fill a dataset (non-data-binding) with
the contents of one or more tables. Close the connection. Connect to
database B
and insert each row into database B.
 
G

Gianco

Since I have more tables to transfer is it possible to add the
datasets content in my tables without specify each single INSERT
statament?

Thanks
Gianco
 
D

Darren Shaffer

yes, use a SqlCeDataAdapter, fill it, then call update on it to fill an
empty destination table.
 

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