DbSyncProvider Class

Encapsulates a 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 RelationalSyncProvider
'Usage
Dim instance As DbSyncProvider
[SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")] 
[CLSCompliantAttribute(false)] 
public class DbSyncProvider : RelationalSyncProvider
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1706:ShortAcronymsShouldBeUppercase")] 
[CLSCompliantAttribute(false)] 
public ref class DbSyncProvider : public RelationalSyncProvider
/** @attribute SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") */ 
/** @attribute CLSCompliantAttribute(false) */ 
public class DbSyncProvider extends RelationalSyncProvider
SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") 
CLSCompliantAttribute(false) 
public class DbSyncProvider extends RelationalSyncProvider

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: Provision a Server Database for Collaborative Synchronization (Non-SQL Server).

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.RelationalSyncProvider
        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