Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ConflictType Enumeration
Collapse the table of content
Expand the table of content

ConflictType Enumeration

Defines the types of conflicts that can occur during synchronization.

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in microsoft.synchronization.data.dll)

public enum ConflictType
public enum ConflictType
public enum ConflictType

 Member nameDescription
ClientDeleteServerUpdateThe client deleted a row that the server updated. 
ClientInsertServerInsertThe client and server both inserted a row that has the same primary key value. This caused a primary key violation. 
ClientUpdateServerDeleteThe server deleted a row that the client updated. 
ClientUpdateServerUpdateThe client and the server updated the same row. 
ErrorsOccurredThe client or server store (typically a database) threw an exception while applying a change. 
UnknownThe client synchronization provider can classify all conflicts that it encounters, but the server synchronization provider cannot. Therefore, some conflicts are classified as Unknown

A conflict occurs when the same row is inserted, updated, or deleted at more than one place between synchronizations. Conflicts are always defined as having occurred between the server and client that are currently synchronizing. However, that does not mean that the conflicting change at the server necessarily originated at the server. For more information, see How to: Handle Data Conflicts and Errors.

The following code example specifies a value of RetryWithForceWrite for client-update/server-delete conflicts. To view this code in the context of a complete example, see How to: Handle Data Conflicts and Errors.

if (e.Conflict.ConflictType == ConflictType.ClientUpdateServerDelete)
{

    //For client-update/server-delete conflicts, we force the client 
    //change to be applied at the server. The stored procedure specified for 
    //customerSyncAdapter.UpdateCommand accepts the @sync_force_write parameter
    //and includes logic to handle this case.
    Console.WriteLine(String.Empty);
    Console.WriteLine("***********************************");
    Console.WriteLine("A client update / server delete conflict was detected.");

    e.Action = ApplyAction.RetryWithForceWrite;
    
    Console.WriteLine("The client change was retried at the server with RetryWithForceWrite.");
    Console.WriteLine("***********************************"); 
    Console.WriteLine(String.Empty);
 
}

Show:
© 2015 Microsoft