locked
Get information about applied changes after synchonization RRS feed

  • Question

  • Hi, I'm using the MS Sync Framework 2.0 to synchronize two SQL Server Databases. After synchronization I want to know, which data has been changed (kind of summary) to pass affected rows.

    How do I get this information about applied changes?
    Tuesday, July 27, 2010 12:27 PM

Answers

  • Hello Philipp,

    SyncOrchestrator returns SyncOperationStatistics object which contains summary of changes (# of total changes, successful download / upload applies, failed applies, etc...)

    To find out what row has specifically changed, you need to subscribe to events to find out. For example, applying changes event gives you access to dataSet consisting of changes being applied.

    Hope this helps,

    Patrick

     

     

    Tuesday, July 27, 2010 8:14 PM

All replies

  • Hello Philipp,

    SyncOrchestrator returns SyncOperationStatistics object which contains summary of changes (# of total changes, successful download / upload applies, failed applies, etc...)

    To find out what row has specifically changed, you need to subscribe to events to find out. For example, applying changes event gives you access to dataSet consisting of changes being applied.

    Hope this helps,

    Patrick

     

     

    Tuesday, July 27, 2010 8:14 PM
  • Thank you Patrick!

    So I get the value of the primary key this way:

    private void sqlSyncProviderRemote_ApplyingChanges(object sender, DbApplyingChangesEventArgs e)
    {
      DataSet dataSet = e.Context.DataSet;
      foreach (DataTable table in dataSet.Tables)
      {
        foreach (DataRow row in table.Rows)
        {
          Guid id = row.Field<Guid>(1);
          // pass id to another method 
        }
      }
    }
    
    Is this the best way or is there a better solution?

    Wednesday, July 28, 2010 11:12 AM