efficiently copy info from one database to another

P

PaulS

I have 2 sql server ce databases on my PocketPC.
What would be the most efficient way to transfer some of the records
from one database to another if the table structure is the same in
both databases?
I'm using vb.net and the option to create insert statement
by iterating through all fields seems cumbersome because
the table has more than 30 fields.
 
D

Darren Shaffer

Paul,

Have you considered doing an RDA Push from one SQL CE database
to an instance of SQL Server on your desktop and then doing an RDA
pull from the desktop to your second SQL CE database?

-Darren
 
A

Alex Feinman [MVP]

There is a difference between the efficent copy as in quickly executing and
efficient as in quick to implement. IMO the former is more important, since
the latter can be automated to a certain degree by writing a function that
would walk the list of fields and generate an appropriate Insert
SqlCeCommand. The fastest way to do this on the device is to use prepared
command with parameters. Build a command, prepare it and then loop through a
data reader and set parameter values, then execute the command
 
P

Paul S

Darren,
Pocket pc will operate in a remote environment
so RDA is not an option for me...
 
P

Paul S

Alex,
thank you for your advise.

At this moment my objective is to write as less code as possible because
it is a test program.

I'm trying to find a fast substitute for this
embedded Vb line:

rs.AddNew arrayOfFields, arrayOfValues
 

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