DbSyncProvider Class

Abstracts a generic peer synchronization provider that communicates with a peer database and shields the synchronization agent from the specific implementation of the database.

This class is not CLS-compliant.  

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

[SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")] 
[CLSCompliantAttribute(false)] 
public class DbSyncProvider : KnowledgeSyncProvider, IDisposable
/** @attribute SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") */ 
/** @attribute CLSCompliantAttribute(false) */ 
public class DbSyncProvider extends KnowledgeSyncProvider implements IDisposable
SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") 
CLSCompliantAttribute(false) 
public class DbSyncProvider extends KnowledgeSyncProvider implements IDisposable

The principal activities of the peer synchronization provider are as follows:

  • Stores information about tables on the peer that are enabled for synchronization.

  • Enables applications to retrieve changes that occurred in the peer database since the last synchronization.

  • Applies incremental changes to the peer database.

  • Detects conflicting changes.

The following code example instantiates local and remote providers and calls the SetupSyncProvider method in a sample class that was created for this documentation. This method is used so that providers can be configured easily for multiple peers. Several provider commands are specified within this method. For more information about these commands and to view this code in the context of a complete example, see How to: Configure Change Tracking and Synchronize Peers.

DbSyncProvider localProvider = new DbSyncProvider();
DbSyncProvider remoteProvider = new DbSyncProvider();

//Create a provider by using the SetupSyncProvider on the sample class.             
sampleSyncProvider.SetupSyncProvider(localProviderConnString, localProvider);
localProvider.SyncProviderPosition = SyncProviderPosition.Local;

sampleSyncProvider.SetupSyncProvider(remoteProviderConnString, remoteProvider);
remoteProvider.SyncProviderPosition = SyncProviderPosition.Remote;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: