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)

Syntax

'Declaration
<SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")> _
<CLSCompliantAttribute(False)> _
Public Class DbSyncProvider
    Inherits KnowledgeSyncProvider
    Implements IDisposable
'Usage
Dim instance As DbSyncProvider
[SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")] 
[CLSCompliantAttribute(false)] 
public class DbSyncProvider : KnowledgeSyncProvider, IDisposable
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1706:ShortAcronymsShouldBeUppercase")] 
[CLSCompliantAttribute(false)] 
public ref class DbSyncProvider : public 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

Remarks

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.

Example

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;
Dim localProvider As New DbSyncProvider()
Dim remoteProvider As 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

Inheritance Hierarchy

System.Object
   Microsoft.Synchronization.SyncProvider
     Microsoft.Synchronization.KnowledgeSyncProvider
      Microsoft.Synchronization.Data.DbSyncProvider

Thread Safety

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

See Also

Reference

DbSyncProvider Members
Microsoft.Synchronization.Data Namespace