Friday, March 23, 2012

How many ways are provided by Microsoft to import data into SQL Mobile database?

SQL Mobile database seems to not provide import/export utilities.

I think using Publication/Subscription is one of the solution, is it right?

Also, besides typing insert statement manually, there are any other ways to transform data to the SQL Mobile database?

There are no formal Import or Export programs/utilities for SQLCe at this point and there is no bulk copy class in the SqlCe namespace. Yes, you can setup a SQLCe database as a subscriber in a Merge replication configuration against a SQL Server Workgroup or better server. You can also write your own INSERT scripts (as I illustrate in an an example in my EBook). Exporting data is simply a matter of writing a class that exposes a DataReader against the database--SqlClient can read that data stream and import it into SQL Server using SqlBulkCopy. This is discussed in my new EBook. See www.hitchhikerguides.net.|||Or simply read it into a dataset and the write it with the XMLWriter.

Here is some sample code for doing the INSERT that was written in a previous post (near end)

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=926140&SiteID=1

No comments:

Post a Comment