Solved

Transferring data from SQL to SQLce

Posted on 2013-01-28
6
391 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If your app took Google’s lash recently, here are the 5 most likely reasons.
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now