Answered by:
Database synchronization via Sync Framework with compact framework 2.0

Question
-
I'm looking for a way to synchronize a mobile device with an sql server database without a direct connection to the database.
We want synchronize through a webservice over the HTTP protocol.
Currently we are using SqlCeRemoteDataAccess to manually synchronize the mobile sql compact database with the host database through sql server agent (sqlcesa.dll) on IIS website.
I have already tried the example on page http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=2214 but i always get a COM exception (class not registered) at"new SyncKnowledge()". Is there a way to get this to work?
software setup:
-visual studio 2005 sp1
-.net compact framework 2.0
- sql server compact 3.5
- Microsoft Sync Framework SDK v1.0
- Microsoft Sync Framework for Devices CTP1Thursday, September 2, 2010 11:20 AM
Answers
-
sorry, i missed the VS 2005 part. there is no designer support for VS 2005 so you wont find the Local Database Cache project item.
btw, you can find another sample here: http://www.microsoft.com/downloads/details.aspx?FamilyID=42E26CFB-C70C-498F-B916-A7F6EB1E43CC&displaylang=en&displaylang=en
if you download SyncServicesSamplesSP1.exe, there's an example SyncServices_CSharp_DevicesSample. It's in VS 2008, but i think you can create a new project in VS 2005 and simply add the files yourself.
- Marked as answer by xodder Tuesday, September 7, 2010 11:07 AM
Friday, September 3, 2010 7:24 AM -
you can whip up the code without the designer if you want. but the easier and faster way is to move to vs2008/3.5 so you can easily grab the samples, run them and figure out how they work rather than spending most of your time just trying to get it to compile :)
- Proposed as answer by Dong CaoMicrosoft employee Friday, September 3, 2010 6:12 PM
- Marked as answer by xodder Tuesday, September 7, 2010 11:07 AM
Friday, September 3, 2010 2:44 PM
All replies
-
SqlCeSyncProvider is not supported on devices. you will have to use SqlCeClientSyncProvider.
here's a step by step implementing synchronization between SQL CE on Device and SQL Server: http://msdn.microsoft.com/en-us/library/dd938879.aspx
- Proposed as answer by L Zhou [MSFT]Editor Thursday, September 2, 2010 1:59 PM
- Marked as answer by Dong CaoMicrosoft employee Thursday, September 2, 2010 11:49 PM
- Unmarked as answer by xodder Friday, September 3, 2010 6:52 AM
Thursday, September 2, 2010 1:53 PM -
Thanks for your post.
The page you supplied i had already in my bookmark list but i don't can get this to work because they are using a WCF ServiceContract
in Visual Studio 2008. As i said before i'm using Visual Studio 2005, is it possible to generate data caches too?
Friday, September 3, 2010 6:52 AM -
sorry, i missed the VS 2005 part. there is no designer support for VS 2005 so you wont find the Local Database Cache project item.
btw, you can find another sample here: http://www.microsoft.com/downloads/details.aspx?FamilyID=42E26CFB-C70C-498F-B916-A7F6EB1E43CC&displaylang=en&displaylang=en
if you download SyncServicesSamplesSP1.exe, there's an example SyncServices_CSharp_DevicesSample. It's in VS 2008, but i think you can create a new project in VS 2005 and simply add the files yourself.
- Marked as answer by xodder Tuesday, September 7, 2010 11:07 AM
Friday, September 3, 2010 7:24 AM -
Seems to be a good sample but i even ran into problems using it with Visual Studio 2005.
First point is that partial methods are used which were introduced with .NET 3.0,
so JobListSyncAdapter, GBACacheSyncAgent, JobListSyncTable and so on are not usable without modifications.
I will continue next week trying to get the projects from that sample to work but at the moment it doesn't looks like a easy task.
Some types are not available and it's hard to get that example to work with not much understanding on how the classes interact with
each other.
Maybe the only way to synchronize a device with sync framework is to use VS 2008 and .NET 3.5?
What do you suggest is the better solution, using .NET 2.0 or 3.5? Are there any feature/functional differences?
Thanks at all.Friday, September 3, 2010 9:59 AM -
you can whip up the code without the designer if you want. but the easier and faster way is to move to vs2008/3.5 so you can easily grab the samples, run them and figure out how they work rather than spending most of your time just trying to get it to compile :)
- Proposed as answer by Dong CaoMicrosoft employee Friday, September 3, 2010 6:12 PM
- Marked as answer by xodder Tuesday, September 7, 2010 11:07 AM
Friday, September 3, 2010 2:44 PM