Going N Tier w/WCF, Synchronizing data using Sync Services for ADO.NET and SQL Server Compact Edition

In part 1, I used the Visual Studio Orcas Sync Designer to configure and synchronize 3 lookup tables to be cached locally in SQL Server Compact Edition using the Sync Services for ADO.NET CTP.

In part 2 of this screen cast, I take the cached lookup tables and split up the client and server sync components using WCF to glue them together.


Comments (24)

  1. I just saw that steve does a couple of very cool screen casts showing off how easy it will be for WinForms

  2. Byteabyte says:

    Siguiendo la línea que os comentaba en el post anterior donde se mostraba un ejemplo que nos contaron

  3. Michael says:

    You mentioned that the bits you were using were after the February CTP, are they included in the March CTP?

  4. Steve Lasker says:

    The designer features I was showing will be available in Beta 1.  


  5. Steve,

    It would be great to see a "part 3" that showed how these sync services can be used with an Infopath 2007 form …to support automatic updating of InfoPath download list controls (via InfoPath secondary data sources).


  6. Marius says:

    Hi Steve,

    Do Sync Services run on Tablet XP?



  7. Earlier this year the .NET Compact Framework team announced that there was going to be an implementation

  8. So one of the things that was introduced at MiX07 was this thing called Astoria. What I gather is that it provides a REST interface to a data model that you express via the entity framework and a client API to interact with the services so you don't

  9. Steve Lasker says:

    Hi Marius,

    Yes, Sync Services runs on all desktop operating systems.  As noted, it will run on devices as well, but will be a bit delayed from the desktop release.  Definition of a bit is still in the works.


  10. Steve Lasker says:

    Hi Michael,

    I hadn’t thought of Infopath, it’s a great idea.  We are building some demos that will show how to use SQLce and Sync Services with Word and Excel docs.  Using VSTO you can open any ADO.NET datasource, so imagine having a purchase order word document setup for your sales folks.  As they travel in the field they can still build orders for their customers with Word.  The word task bar could have UI to select from the cached product catalog locally.  To update the product catalog, assuming you’re online, simply press an update button in the task bar.  

    I’m not really that well versed in the Infopath APIs, so I can’t promise a sample myself, but I’d be happy to link to one if you’d like to create it.


  11. Kerry says:


    Any update for the Ntier sample to match Orcas Beta 1. Have followed your screencast but the code generated by VB looks quite different?



  12. Steve Lasker says:

    The goals for B1 were download cachingwere missing enough pieces with WCF and some bugs between the designer and runtime that made it unrealistic to show.  Beta 2 however, is solid for these scenarios.  Rather than confuse developers on what code works with which build, I’ve been holding off ’till B2 is available.  We should have the B2 version of Sync Services and SQLce available soon as well.  


  13. zac morris says:

    Great demo and great tools.  

    The demo builds in 20 minutes what took me two months 5 years ago with VB6, Access, home brewed XML RPC over HTTP, PHP and MySQL.

    I notice that the ‘Advanced’ button on the WCF connection wizard that is in the demo did not make it into B1.  The ‘use shared types’ checkbox is exactly what I was wishing was there.  The ‘thou shall not share types’ philosophy is nice and all but if you own both ends of the wire it’s a real PITA.  I would really love to see it in B2!

    The sync designer keeps crashing on me but I’ll assume that will be fixed in B2.

    It would be great if the sync designer supported more of the underlying functionality (uploads).

  14. Bob says:

    I’m following along with your great video, but I can’t seem to test the WcfSyncService AND add it as a reference. If you debug the WcfSyncService you are unable to add a reference while it’s debugging. If you stop debugging, you are able to add a reference, but the service is no longer running! Any ideas

    Thanks again!


  15. Steve Lasker says:

    Sorry Bob,

    I might have breezed over this step too quickly in the screencast. In Beta 2, the WCF service doesn’t really self host properly. The way I get it to work is to set the WCF Service project as the startup project. I then hit CTRL+F5 to start without debugging. This frees Visual Studio from actually running the WCF Service. With the WCF Service running, decoupled from VS, I then set my client app as the startup project, and add the WCF reference to the now running WCF Service. I can then hit F5 and debug my app, that communicates with the self hosted WCF Service.

    The WCF team is planning on getting this fully functional in RTM.

    Hope this helps,


  16. With the release of vs2008 there doesn’t seem to be an implementation of OrganicOnion?..

    How can I use Syn Services with wcf services???



  17. Steve Lasker says:

    Hi Chris,

    As the name would imply, it really didn’t meet ship quality names :).  The type we shipped was named:


    I’ve published a sample here that includes all the RTM code.


  18. chris says:

    I’ve followed the example and have it working.  The challenge I have is now deploying it to work on our iis server.  Any tips on how to deploy this solution so it will work on iis and not jus the dev box?



  19. Steve Lasker says:

    Hi Chris,

    When you say, how to deploy on an IIS server, are you asking how to move from the self hosted WCF project to an IIS project?

    There are a few challenges here.  Web projects aren’t really projects in a typical VS way.  Meaning in 2005 there was an effort to create a projectless project.  This means there are several VS infrastructure Services missing.  However, that’s ok, as it just means you have to use some best practices to make this work.

    If you create a Class Library project, use the Sync Designer to target the Server Config items at this Class Library, then what you can do is simply add the class library dll to your web project.  You can do WCF Web projects, or even do the old tried and true Web Service project and simply wrap the calls with “Web Methods”.

    Make sense?


  20. Tae says:

    Hello Steve,

    Following on Chris’ issue with IIS, can you point me to a sample or more detailed "How-To" regarding deployment to IIS? What I am looking for is taking the WCF portion in the demo and instead of having it on the localhost, move it to a "production" web server. I emailed Liam because he produced a similar video, but he responded by saying he doesn’t know enough of WCF to go beyond the local environment.

    This is the only part that I am stuck on because I am use to the "old" .asmx webservice style but not Sync AND WCF.



  21. Tom Williams says:

    Hi Steve

    As per the request from Tae, can we please have a ‘How To’ on how to deploy this in IIS.

    I really dont know where to start with this now?



  22. Allan Pedersen says:

    We have a working project, but when updating too many rows (changes) from the local database to the server via WCF, we get an error 400 Bad Request. At the System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.Http.RequestChanngelHttpChannelRequest.WaitForReply(TimeSpan timeout).

    Do you have any idea how to increase the Timeout.

  23. Steve Lasker says:

    Hi Allan,

    If this works for small payloads, but fails on larger payloads, then this likely lies in the WCF configuration information.  Unfortunately, I’m not a WCF expert in WCF, but if you can turn on debugging info, you should be able to figure out which parameter is causing you the pain.  


  24. lakshmi says:

    Hi ,

    Can you Please Explain  what is the difference  between

    Synchronization Services for ADO.NET using WCF


    Synchronization Services for ADO.NET using WEB SERVICES