Search code examples
c#sql-serversynchronizationmicrosoft-sync-framework

Tracking changes uploaded, downloaded using Microsoft Sync Framework


I am syncing two of my databases using Microsoft Sync Framework. One database resides at the server and the other is on the local/client side. The syncing is going fine, I just want to get the details or the database record of the records being uploaded or being dowloaded. Not the stats, but the complete records with all the columns details. In simple words I want to see the details of the data being uploaded and being downloaded.


Solution

  • public void Report(DbSyncProgressEventArgs args)
        {
            if (args.ScopeProgress.TotalChangesApplied <= 0)
            {
                intTotalChanges = args.ScopeProgress.TotalChanges;
            }
            listSyncProgress.Items.Clear();
            listSyncProgress.Items.Add("Total Tables  : " + args.ScopeProgress.TablesProgress.Count);
            listSyncProgress.Items.Add("Total Changes : " + intTotalChanges);
            listSyncProgress.Items.Add("Total Applied : " + args.ScopeProgress.TotalChangesApplied);
            listSyncProgress.Items.Add("Table Name    : " + args.TableProgress.TableName);
            listSyncProgress.Items.Add("Total Failed  : " + args.ScopeProgress.TotalChangesFailed);
    
            Application.DoEvents();
        }
    

    Ref: http://social.technet.microsoft.com/wiki/contents/articles/2190.tutorial-synchronizing-sql-server-and-sql-server-compact-sync-framework.aspx