Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6878323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:42:34+00:00 2026-05-27T04:42:34+00:00

I make synchronization between two SQL Express DB, one is server other one is

  • 0

I make synchronization between two SQL Express DB, one is server other one is client.

I have next code what make synchronization:

        /// <summary>
        /// Sync to Providers
        /// </summary>
        /// <param name="localProvider">can be RelationalProvider Proxy !!! (WCF)</param>
        /// <param name="remoteProvider">RelationalProvider Proxy !!! (WCF)</param>
        /// <param name="syncDirectionOrder"></param>
        /// <returns></returns>
        private SyncOperationStatistics SynchronizeProviders(KnowledgeSyncProvider localProvider, KnowledgeSyncProvider remoteProvider, SyncDirectionOrder syncDirectionOrder)
        {
            localProvider.Configuration.CollisionConflictResolutionPolicy = CollisionConflictResolutionPolicy.RenameDestination;
            localProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.SourceWins;

            remoteProvider.Configuration.CollisionConflictResolutionPolicy = CollisionConflictResolutionPolicy.RenameSource;
            remoteProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.DestinationWins;

            SubscribeResultEvent(localProvider);

            SyncOrchestrator orchestrator = new SyncOrchestrator
            {
                LocalProvider = localProvider,
                RemoteProvider = remoteProvider,
                Direction = syncDirectionOrder
            };

             SyncOperationStatistics stats = orchestrator.Synchronize();
                    return stats;            
        }

I do not know why but my server db is always win, does not matter server is localProvider or
RemoteProvider, and rewrite client data, but I want to make setting what client is always win.

But I can’t understand how MS Sync Framework do it.

What I need to setup ?

thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:42:34+00:00Added an answer on May 27, 2026 at 4:42 am

    In Sync Framework you can specify the conflict resolution policy on the synchronization providers, as described on MSDN:

    Microsoft Sync Framework supports some simple conflict resolution by default. You can configure the conflict resolution policy of the provider and the Sync Framework will perform conflict resolution for you. By default, the Sync Framework supports the following five types of conflict resolution policy.

    Source wins: the source replica always wins if there is a conflict.

    Destination wins: the destination replica always wins if there is a
    conflict.

    Merge: the changes from both source and destination are
    merged to form a new version of the item, which is then sent to the
    destination to be applied.

    Log: conflicts are ignored and the
    conflicting item information is sent to the SaveConflict event of the
    class implementing INotifyingChangeApplierTarget.

    Defer: completely
    ignore the conflicts and the destination store will not receive
    information regarding the conflicts.

    All of these conflict resolution policies are applicable at item level but only source wins and destination wins apply to session. Sync policy is specified for the provider by setting the ConflictResolutionPolicy property.

    destinationProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.DestinationWins;

    So you can’t specify directly whether you want the client or server to win all the time, because it depends on the direction the data is being synchronized as to which provider is the source/destination.

    You can also write a custom provider and override the conflict resolution event to specify more complex custom conflict handling. A discussion of that can be found here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd317247%28v=VS.85%29.aspx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two threads, and I want to make sure I am doing the
I'm wondering what good ways there would be make assertions about synchronization or something
While creating a file synchronization program in C# I tried to make a method
I am trying to make a simple script to automate and log synchronization via
Make a new AS3 Document in Flash, paste in the following code and run
To make things easier when switching between machines (my workstation at the office and
We make infrastructure services (data retrieval and storage) and small smart client applications (fancy
As far as I understand the Client Server Scenario (aka Offline Scenario) it is
I want to make a procedure that does one way syncrhonization of a folder
I am in the midst of changing my JPA code around to make use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.