locked
How to handle conflicts in ApplyChangeFailed with Change Tracking in use RRS feed

  • Question

  • In the ApplyChangeFailed event, I want to update the client or server based on which conflicting change was made most recently.

    I understand that if I have SQL create the columns to track the update timestamps, I can do something like this:

            Dim clientChanges As DataTable = e.Conflict.ClientChange
            Dim serverChanges As DataTable = e.Conflict.ServerChange

            If (CDate(clientChanges.Rows(0)("ModifiedDate")) > CDate(serverChanges.Rows(0)("ModifiedDate"))) Then
                e.Action = Microsoft.Synchronization.Data.ApplyAction.RetryWithForceWrite
            End If

    But if I have SQL 2008 Change Tracking turned on, then there will not be a "Modified Date" column in my table and the above won't work.  So how do I figure out which change - client or server - was made most recently when I have Change Tracking in use?

    Saturday, July 10, 2010 5:41 PM

All replies

  • have you tried including SYS_CHANGE_VERSION in the column list?
    Monday, July 12, 2010 12:53 PM