locked
Overriding sync anchors RRS feed

  • Question

  • Is there a recommended way for overriding the anchors so that you can always upload and download based on a dynamic filter rather than create and update dates? I know there are methods for this but what values do we set the anchors to? I got the download working by setting TableReceivedAnchor to an old date like '1/1/1998'. However, the upload doesn't work. The new anchor is set as follows:

     

    anchorCmd.CommandText = "Select @" + SyncSession.SyncNewReceivedAnchor + " = getdate()";

     

     

    Any suggestions?

     

    Thanks,

    Arshad

    • Moved by Max Wang_1983 Friday, April 22, 2011 8:08 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, April 7, 2008 8:26 PM

Answers

  • I'll take that back. When you do a snapshot, it doesn't create any anchors. So if you upload it will not upload anything. In my case, since I used the SyncAdapterBuilder, I first download using SyncDirection.DownloadOnly, then removed the sync anchor in SelectInsertsCommand.CommandText, then upload with SyncDirection.UploadOnly and everything works fine with a dynamic filter. You do however have to let the SyncParameters remain in the collection. Works like a charm.

     

    Arshad

     

    Tuesday, April 8, 2008 5:36 PM

All replies

  • Worked around this. The strategy is to force the upload of all data from the field reps first regardless of anchors and then get a snapshot of data from the server based on a dynamic filter. This way the dynamic filter doesn't have to bother about the create date of the item being later than the anchor date.

     

    Arshad

     

    Tuesday, April 8, 2008 2:22 PM
  • I'll take that back. When you do a snapshot, it doesn't create any anchors. So if you upload it will not upload anything. In my case, since I used the SyncAdapterBuilder, I first download using SyncDirection.DownloadOnly, then removed the sync anchor in SelectInsertsCommand.CommandText, then upload with SyncDirection.UploadOnly and everything works fine with a dynamic filter. You do however have to let the SyncParameters remain in the collection. Works like a charm.

     

    Arshad

     

    Tuesday, April 8, 2008 5:36 PM