Search code examples
c#wpfmicrosoft-sync-framework

Microsoft Sync Framework 2.1 Detecting if Sync is Required


I'm currently working on an application which provides the user with the ability to store records on there local database and then Sync them to the server copy when they have an Internet Connection.

Is there a method within the Framework that will tell me if synchronisation is required without performing the actual synchronisation?


Solution

  • there's nothing in the API specifically for checking if a sync is required. you can call GetChanges to retrieve changes, but it's the same method used during sync.

    another alternative is to store the last sync time, alter the triggers to update the last update time on the tracking tables and compare and compare last sync time with the last update time. (e.g., select top 1 from xxxx_tracking where lastupdatetime > lastsynctime)

    that would still require a query on the tracking table.