Answered by:
peer laptop synch architecture

Question
-
My scenario comprises several traveling persons who occasionally meet to snyc their databases. Everybody owns a PC with SQL Server Compact containing the same database. There is no centralized SQL Server available.
During the meeting, the databases needs to be sync’d for which the Microsoft Sync Framework will be used. So at the end of the meeting everybody has the complete up-to-date database.
Idea a) is to use an ad-hoc WLAN network, idea b) is to use one or more USB sticks for exchanging the databases.
The SQL Server Compact databases on hard disks as well as on USB stick need to be encrypted.
Is this possible with the sync framework and SQL Server Compact?
Is there a code sample for sync’ing two SQL Server Compact databases?
None of the users is computer-literate. So setting up the ad-hoc network, exchanging keys/passwords, synchronization etc. must happen in code. The user should never see a key/password.
Other persons who happen to be in the same room should not be able to fetch any data from a PC or misuse a stolen USB stick.
Monday, November 29, 2010 4:45 PM
Answers
-
Hi,
SqlCeSyncProvider supports peer sync among SQL CE databases. Please take a look of the SQL Server to SQL CE sync sample: http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3422. It should not be difficult to replace the SQL Server database (SqlSyncProvider) with a SQL CE database (SqlCeSyncProvider) to make this sample to be a pure SQLCE to SQLCE sync application.
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Proposed as answer by Dong CaoMicrosoft employee Tuesday, November 30, 2010 10:56 PM
- Marked as answer by herbertf Wednesday, December 1, 2010 1:30 PM
Tuesday, November 30, 2010 10:56 PM -
Hi,
If you haven't changed the sample code yet, it is surprised to know the sync doesn't work. Please check if both databases has a "scope_info" table created.
Also, how did you modify the rows? If you modify them from the sample UI, it may not impact the database due to the sample limitation. Please try to modify rows in your database directly with TSQL statements.
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Marked as answer by herbertf Friday, December 3, 2010 8:23 AM
Wednesday, December 1, 2010 7:51 PM -
the most recent documentation is at http://msdn.microsoft.com/en-us/library/bb902854(v=SQL.110).aspx
the Local Database Cache project item is not available in all VS Project types. what project are you creating?
also, the Local Database Cache uses a different provider than the SqlCeSyncProvider referred to by Dong above.
- Marked as answer by herbertf Friday, December 3, 2010 12:43 PM
Friday, December 3, 2010 8:40 AM
All replies
-
Hi,
SqlCeSyncProvider supports peer sync among SQL CE databases. Please take a look of the SQL Server to SQL CE sync sample: http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3422. It should not be difficult to replace the SQL Server database (SqlSyncProvider) with a SQL CE database (SqlCeSyncProvider) to make this sample to be a pure SQLCE to SQLCE sync application.
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Proposed as answer by Dong CaoMicrosoft employee Tuesday, November 30, 2010 10:56 PM
- Marked as answer by herbertf Wednesday, December 1, 2010 1:30 PM
Tuesday, November 30, 2010 10:56 PM -
Thank you!
I got compiler errors "conflicting assemblies" with the sample, removed all references to Microsoft.Syncronization and referenced them again.
When I now run the sample according to readme.txt, there is no synchronization happening except for filling an empty client database. No matter if I add a new row or modify an existing one, the stats dialog always show 0 affected rows. I use German Windows 7 and English VS.2010 Ultimate. Is there any hint you can give me?
thank you, herbert
Wednesday, December 1, 2010 3:04 PM -
Hi,
If you haven't changed the sample code yet, it is surprised to know the sync doesn't work. Please check if both databases has a "scope_info" table created.
Also, how did you modify the rows? If you modify them from the sample UI, it may not impact the database due to the sample limitation. Please try to modify rows in your database directly with TSQL statements.
Thanks,
Dong
This posting is provided AS IS with no warranties, and confers no rights.- Marked as answer by herbertf Friday, December 3, 2010 8:23 AM
Wednesday, December 1, 2010 7:51 PM -
Thank you, that works.
Is there any "complete" state-of-the-art documentation about Microsoft Sync on the web? I find plenty of old stuff, outdated books ... from 2007/2008 nothing really new.
- Edited by herbertf Friday, December 3, 2010 10:33 AM
Friday, December 3, 2010 8:23 AM -
the most recent documentation is at http://msdn.microsoft.com/en-us/library/bb902854(v=SQL.110).aspx
the Local Database Cache project item is not available in all VS Project types. what project are you creating?
also, the Local Database Cache uses a different provider than the SqlCeSyncProvider referred to by Dong above.
- Marked as answer by herbertf Friday, December 3, 2010 12:43 PM
Friday, December 3, 2010 8:40 AM