Transfer data from a SQL CE database to another one

  • Thread starter Thread starter Gianco
  • Start date Start date
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
 
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.
 
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
 
yes, use a SqlCeDataAdapter, fill it, then call update on it to fill an
empty destination table.
 
Back
Top