Solved

Transferring data from SQL to SQLce

Posted on 2013-01-28
6
393 Views
Last Modified: 2013-12-27
This question was answered before but the link showed in the answer gives a 404 error. I full copy this question asked by JedNebula.

I am currently developing an application for a mobile device in VB - Visual Studio 2008. I am just looking to see what my options are for transferring data from an SDF database file on the device to a SQL 2005 live database on the local company's network (i.e. not going to be external to the building) and visa versa. The data will be only a couple of tables - one of which will contain approx 200k rows.

I have done some Google searches and found that 'replication' is an option although this seems to require IIS being setup and a web address being passed in to the object's properties - even if it's a local sync. I'm not sure, but does this also require the full version of SQL being installed as opposed to just the express version?

I have also explored the SQLClient.SqlDataReader and SQLServerCE.SqlCeCommand method by looping through all the rows. - Obviously this is very slow.

I'm just looking to know what my options are before I go too far down one path&
0
Comment
Question by:BemboX
  • 2
  • 2
  • 2
6 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 38827512
Is this a one time deal, or you want something like replication where the data is synced all the time?
0
 

Author Comment

by:BemboX
ID: 38827537
It's a one time deal. I need to transfer data from sql server to sqlce, do some work offline using handhelds and then, after a few hours, transfer data from sqlce to sql server. Next day, again and so on.
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 200 total points
ID: 38827560
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 16

Expert Comment

by:hjgode
ID: 38838304
Here is an utility to convert SQL Server data to SQL Server Compact files: http://www.codeproject.com/Articles/25685/SQL-Server-to-SQL-Server-Compact-Edition-Database

sql compact convert
0
 

Author Comment

by:BemboX
ID: 38877869
I want to copy only some fields from some tables using a query. Is any way to do that using VB (visual studio 2008)?
0
 
LVL 16

Accepted Solution

by:
hjgode earned 300 total points
ID: 38879291
Hello

I assume using VB code and iterating to all rows of a table to copy it using SqlClientCE and SqlServerCE will be slower than doing it with the above tool and then deleting the unneeded data afterwards. This is valid if that is a one time convert.

If you need to update the SQLServer data periodically with the SQLCE data, using Replication or SQLClientCE and SQLServerCE is the only option and is only slow on first replication.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
The 21st century solution to antiquated pagers.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question