Microsoft Sync Framework is data synchronisation software used to synchronise application data with databases. It allows you to plug into synchronisation services provider data stores and manage data exchange without any additional custom programs. Microsoft Sync Services for ADO.NET is the synchronisation provider for synchronising databases using ADO.NET. It is intended for use in the offline applications to cache data locally. The Windows Communication Foundation (WCF) is an application programming interface (API) in the ADO.NET Framework and can be used for the programming of sync services applications.
- Skill level:
- Moderately Easy
Download and install the Sync Framework from the Microsoft MSDN website (see Reference 3 for the detailed instructions).
Click the "Start" button in the Windows and select the "Sync Framework" option from the "All Programs" menu. Click on the "New" option in the "File" menu.
Select the "WCF Service Library" in the "Library Type" box and type in "WFCSyncServiceP01" in the "Project Name" box to open a new project based on WCF Service Library.
Double-click the "LocalDataCache1.sync" in the "Configure Data Synchronization" window to open the local data cache file.
Click on the "Advanced" check box to expand the connection menu and change the Server project location to "WCFSyncServiceP01."
Click the "OK" button to create the "LocalDataCacheP01.Server.Sync" and "LocalDataCacheP01.Server.SyncContract.vb" synchronisation files.
Remove "//" comment characters in the server definition section of the "LocalDataCacheP01.Server.SyncContract.vb" file.
Move the "services" section of the "LocalDataCacheP01.Server.SyncContract.vb" file to the "system.serviceModel" section of the "App.config" file.
Move the "serviceBehaviors" section of the "LocalDataCacheP01.Server.SyncContract.vb" file to the "behavior" section of the "App.config" file.
Insert the following code at the beginning of the "LocalDataCacheP01.Server.sync." file:
Partial Class LocalDataCache1ServerSyncProvider
Private Sub LocalDataCache1ServerSyncProvider_ApplyChangeFailed _ (ByVal sender As Object, _ ByVal e As Microsoft.Synchronization.Data.ApplyChangeFailedEventArgs) _ Handles Me.ApplyChangeFailed e.Action = Microsoft.Synchronization.Data.ApplyAction.RetryWithForceWrite End Sub
Right-click on the "LocalDataCache1.sync" file in the "WFCSyncServiceP01" project window and select the "View" option.
Add the following under the "OnInitialized" definition section:
Me.RemoteProvider = New Microsoft.Synchronization.Data.ServerSyncProviderProxy(
to sync services using WCF.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for