SQL Programming
Re: Sql server compact edition
07/02/2009
02:11:42 PM
2OU0UFD81 Show this entire thread in new window
From:
Phil Connolly
To:
Alan Wyne
Attachments:
None
I did a project last year that did what you are describing: a handheld mobile (Symbol) which worked disconnected and synced to a SQL Server over a wireless network.

Gotchas: deploy the SQL CE appropriate for your handheld's processor. There are CAB versions for each OS/processor combination.

What is your app being developed in? .Net? If so, you make reference to System.Data.SqlServerCe and then you will be able use the SqlCe specific database classes, like SqlCeConnection, SqlCeCommand, SqlCeParameter, etc. They all just work pretty much similar to .Net's System.Data.SqlClient classes.

System.Data.SqlServerCe has some classes specific for SQL mobile apps, like SqlCeEngine which you can use to create a new database.

For synchronization, you have the options of Microsoft Synchronization Services, merge replication or RDA (push/pull). I used RDA, available to my mobile app using the class SqlCeRemoteDataAccess. Either way, you need a web service endpoint on your network that can talk to your SQL Server (installed for you as part of the SQL CE Server Tools). By the way, I think RDA is going to go away... Microsoft is pushing Synchronization Services instead. Whatever... RDA is pretty easy (IMO).

If your device has an emulator, you will much appreciate that. It is a pain to have to test directly on the mobile device...

Hope all that helps... good luck,
-phil.

Has anyone used this in mobile applications? I am considering it for a handheld application that must work disconnected from the network and then sync back to the main SQL server database on the network. Just looking for recommendations, gotcha's etc. Or if anyone has an alternative they feel is better, I'm open to recommendations.

thanks

Alan Wyne