Sync Services Ado.net conflict resolution

614 views Asked by At

is it possible to solve conflicts on client side with sync services for ado.net? for example, with Client Insert Server Insert, updating client's table id (on client side) , tks

1

There are 1 answers

0
JohnnyJP On

While on the server side you can do:

Partial Public Class NorthwindCacheServerSyncProvider
    Private Sub ApplyChangeFailedEvent(…) Handles Me.ApplyChangeFailed
        Dim clientChanges As DataTable = e.Conflict.ClientChange
        Dim serverChanges As DataTable = e.Conflict.ServerChange
        ' Code to resolve conflict 
           If (clientChanges.Rows(0)("ModifiedDate") > _
               serverChanges.Rows(0)("ModifiedDate") Then e.Action =                      ApplyAction.RetryWithForceWrite 
           End If         

You cant do this on the client, but, you can intercept the applying changes event and take appropriate action, like this...

Partial Public Class NorthwindCacheClientSyncProvider
    Private Sub ApplyingChangesEvent(…) Handles Me.ApplyingChanges
        Dim clientChanges As DataSet = e.Changes