Gyan Chandra Srivastava
Gyan Chandra Srivastava

Reputation: 1380

how to customize sync according to selected data only sync framework / trick to do it

I am developing an sync database application for one of my client i am done with synchronization but now i stuck at a part that i don`t want to sync complete table i just wana sync dynamically selected record through sync framework

using sqlce at client end

Any good link which make some help will also be preferable

i am sync ing some thing like below at server

public SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
    {
        return serverSyncProvider.GetChanges(groupMetadata, syncSession);
    }



    public SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
    {
        return serverSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);
    }

Upvotes: 1

Views: 1711

Answers (3)

Ricardo Mendes
Ricardo Mendes

Reputation: 1

Update SelectedCustomer is not enough, the tracking record is syncronized but the real one is not. I had to create a insert/update trigger to update the local_create_peer_timestamp from the master tracking record.

Upvotes: 0

Win
Win

Reputation: 62300

Here is the article written by JuneT ;)

Sync Framework Provisioning

Go to Parameter-based Filters section

JuneT's answer is absolutely correct. The trick is if you select to a row to sync, update that row first before synching (so that tracking table will record the row as updated).

Upvotes: 3

JuneT
JuneT

Reputation: 7860

you can add a filter to restrict the rows being synched. Sync Framework however does not support dynamic filtering. Sync framework does synchronization based on incremental syncs of what has changed since the last sync.

for example, assuming you have a customer table and you let a user pick which customer to sync.

you will most likely store the customers that was picked for synching in another table, let's say SelectedCustomer which would store the user id. and the customer id.

when a user adds or removes a customer from his selection, you would update the SelectedCustomer. However, when you sync Customer table, you won't get anything not unless the specific customer record has been changed since the last sync. Even if a customer was added to a specific user, the actual customer record is not updated, no update, no change detected.

Upvotes: 5

Related Questions