Database Sync: SQL Server and SQL Compact N-Tier with WCF

Shows how to use the Sync Framework 2.1 database providers to configure and execute synchronization between a SQL Server database and one or more SQL Server Compact databases. This sample demonstrates syncing with a central server as well as between two clients.

C# (93.4 KB)
3.7 Star
6,764 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Does not work on VS 2010 out of the box
    4 Posts | Last post December 06, 2013
    • This is an old solution based on .net 3, VS 2008
    • Got this working after nearly 8 hours of configuration. Used:
      Sql Sever CE 3.5sp2 x86 and x64 installed (CE 4 not supported by MS Sync2)
      MS Sync2 x86 (x64 wasn't working with 32 bit everything else)
      VS 2012 64bit admin
      All projects target x86(required) and .Net 4.5(optional)
      Update several references manually.
      Create WebSyncContract.exe.config with contents of app.config in output dir.
      Run WebSyncContract.exe manually and ignore runtime error VS 2012 displays when debugging solution.
      In WebSyncContract.exe.config and app.config set maxReceivedMessageSize and maxArrayLength to 2147483647
      IIS set Application Pool>Advanced Settings>Enable 32-Bit Applications: True
      Of course set SqlSyncProvider.Connection to your Sql Server database in SynchronizationHelper.cs and ServerSynchronizationHelper.cs
    • Sync2.1, wasn't using Sync2
    • I also found this link helpful, although some of the configuration in this blog is not needed if using the sample.
  • How to deploy this service to IIS 7.5
    1 Posts | Last post August 09, 2012
    • Could someone please provide steps required to deploy these services to IIS 7.5. I keep getting the following error when I attempt to access the service as http://localhost/svc_HazTrackOCA/WebSyncContract.SqlWebSyncService.svc.
      The type 'WebSyncContract.SqlWebSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
      There are a number of topics online which show the steps to deploy a WCF service but none that I have found describe how to set this one up.
  • How to deploy publish the service seperately?
    1 Posts | Last post June 29, 2012
    • I have worked with WCF services in the past but this one is structured differently that the ones I have created...there are no .svc files, until the service is published. 
      I am having difficulty connecting to the service when trying to add it as a Service Reference to the WebSharingApp Demo. (I am trying to replicate the way my final project will be structured so, I want to seperate the projects from one another and reference them like I will my final project).
      I have published the WebSyncContract project to c:\Inetpub\wwwroot\TestingService, and I would expect the connection string to be something like http://localhost/TestingService/SqlWebSyncService.svc or http://localhost/TestingService/WebSyncContract.SqlWebSyncService.svc but, neither of these is working. 
      I don't know if this is an actively monitored project any more but, can you advise?
      Thanks for whatever deployment advice you can give.