October 22, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Handling Data Conflicts in the Microsoft Sync Framework

  • April 23, 2009
  • By Matt Goebel, Rachel Baker
  • Send Email »
  • More Articles »

Example 1: ClientUpdateServerUpdate

In this example, we update the row with CustomerId of 2 in both the server and the client and then attempt to re- sync. On the server, we change the FirstName field to Chad. On the client, we change the FavoriteNumber field to 5. We get a ClientUpdateServerUpdate on the server SyncProvider:



Click here for larger image

Listing 1.3 ClientUpdateServerUpdate conflict on the server

If we choose Continue, the server changes "win" and the client's change is lost:



Click here for larger image

Listing 1.4 ClientUpdateServerUpdate conflict on the server with ApplyAction.Continue

If we choose RetryApplyingRow instead, the error is re- thrown because we have not made any changes to the data, so we are just presented with our conflict resolution form again.

If we choose RetryWithForceWrite, the client "wins" and the server changes are lost:



Click here for larger image

Listing 1.5 ClientUpdateServerUpdate conflict on the server with ApplyAction.RetryWithForceWrite

Example 2: ClientInsertServerInsert

In this example, we insert a new row into the server that gets a CustomerId (primary key) of 3. We also insert a new row into the client that gets a CustomerId (primary key) of 3.



Click here for larger image

Listing 1.6 Inserting new rows on both the client and the server

Now, when we try to synchronize, we get a ClientInsertServerInsert conflict on the server SyncProvider:



Click here for larger image

Listing 1.7 ClientInsertServerInsert conflict on the server


Tags: .NET



Page 3 of 4



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel