locked
sync direction questions RRS feed

  • Question

  • I downloaded a sample SQLExpressProviderSample from
    http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=1200
    .  (SQL Express - Client Synchronization Sample (C# v2.0 CTP1) )

    I want to learn this sample and then create a off line project to do the
    following jobs:
    1) user inputs data into local SQL 2008 express (done),
    2) sync local data with remote SQL 2000 (done, sync direction: uploadonly)
    3) administrator update some dictionary tables in remote server (should be no
    problem)
    4) sync remote data with local (will do, sync direction: downloadonly)

    To test, I changed code as below:

    tableOrders.SyncDirection = SyncDirection.UploadOnly
    tableOrderDetails.SyncDirection = SyncDirection.DownloadOnly

    Question:

    UploadOnly is working well. No matter new data or update data in local table,
    remote will be updated as well.
    But, DownloadOnly did not work. I inserted data in remote, hit sync button
    but nothing happend.
    How to fix it?
    Wednesday, April 14, 2010 4:12 PM

Answers

  • only one peer is created because you have to create the subsequent peers using the application itself.

    For the first sync, your peer1 will be the remote db used to initialize the 2nd peer. You can then use the 2nd peer to initialize another peer and so on.

    Once you have created several peers, you can change the sync direction whichever way you want (e.g., SDF to SDF, SQLExpress/Server to SDF, SDF to SQLExpress/SQLServer)

    • Marked as answer by JuneT Thursday, July 8, 2010 1:42 PM
    Thursday, April 15, 2010 11:18 PM

All replies

  • Just curious as to why you want to use the outdates SqlExpressClientProvider sample. With Sync Fx 2.0 we have released good support for synchronizing Sql servers (Express/standard) in a peer to peer fashion. We also have management API's that lets you easily set up your database with all sync related metadata. Can you expand more on your need?
    Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar
    Wednesday, April 14, 2010 5:26 PM
  • No another reason just because did not find out the sample for SQL 2008 express (local) to SQL standard.

    Can you tell me where to download the sample for my case?

    Wednesday, April 14, 2010 8:54 PM
  • you can find details here for the peer to peer/collaboration providers : http://msdn.microsoft.com/en-us/library/dd918848(v=SQL.105).aspx

    there's a sample here (w/WCF): http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=3762

     

    Wednesday, April 14, 2010 10:05 PM
  • I did downloaded this sample but hard to make it running. (I am very new in Sync program)

    I prefer not using WCF. I need a simple sample to start.

    Thursday, April 15, 2010 1:14 PM
  • you can look at the SharingAppDemo-CEProviderEndToEnd sample that comes with the SDK (most likely under C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\2.0\Samples). The first node in the sample can SQLExpress/SQLServer and SQL Compact for the subsequent node. You just have to replace the SqlCESyncProvider with SqlSyncProvider.

    or you can download the other sample here: http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=3422

     

    Thursday, April 15, 2010 1:21 PM
  • I downloaded sample here: http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=3422

    I ran two sql scripts but only one peer1 db was created. This is local or remote db?

    Thursday, April 15, 2010 2:55 PM
  • only one peer is created because you have to create the subsequent peers using the application itself.

    For the first sync, your peer1 will be the remote db used to initialize the 2nd peer. You can then use the 2nd peer to initialize another peer and so on.

    Once you have created several peers, you can change the sync direction whichever way you want (e.g., SDF to SDF, SQLExpress/Server to SDF, SDF to SQLExpress/SQLServer)

    • Marked as answer by JuneT Thursday, July 8, 2010 1:42 PM
    Thursday, April 15, 2010 11:18 PM