views:

130

answers:

1

Hi,

I have a application that uses LocalDataCache to synchronise a SQL Server 2008 Express database to a client database (.sdf file). This works great and I am now managing the conflicts.

I am using this Microsoft resource as a guide: How to: Handle Data Conflicts and Errors

The conflict I am particularly interested in is ConflictType.ClientInsertServerInsert.

I would like to Insert BOTH conflicting rows on the client AND server and I am wondering if there is an internal method to the SyncFramework to do this?

Otherwise my solution is as follows:

0 - Set e.Action = ApplyAction.Continue (no changes).

1 - Save Client conflict (id, tablename) into an array.

2 - Save Server conflict (id, tablename) into an array.

3 - For each item in the client conflict array, insert into server

4 - For each item in the server conflict array, insert into client

I am wondering if the SyncFramework can do this for me as it seems to do everything else for me?

I look forward to your replies. Thanks

A: 

I have fixed this problem now by using a GUID for a PK instead of a auto-incrementing int. This guarantees that each row inserted by the server or any client will be unique. I know there are some disadvantages such as additional storage space and time it takes to search but this is something I am willing to live with (and I will filter the data that the client gets which will help to improve performance).

Belliez