Share via


DbSyncProvider.SyncProviderPosition Property

Gets or sets a SyncProviderPosition enumeration value that represents whether a provider is associated with the local or remote database.

This property is not CLS-compliant.  The CLS-compliant alternative is .

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

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Property SyncProviderPosition As SyncProviderPosition
'Usage
Dim instance As DbSyncProvider
Dim value As SyncProviderPosition

value = instance.SyncProviderPosition

instance.SyncProviderPosition = value
[CLSCompliantAttribute(false)] 
public SyncProviderPosition SyncProviderPosition { get; set; }
[CLSCompliantAttribute(false)] 
public:
property SyncProviderPosition SyncProviderPosition {
    SyncProviderPosition get ();
    void set (SyncProviderPosition value);
}
/** @property */
public SyncProviderPosition get_SyncProviderPosition ()

/** @property */
public void set_SyncProviderPosition (SyncProviderPosition value)
public function get SyncProviderPosition () : SyncProviderPosition

public function set SyncProviderPosition (value : SyncProviderPosition)

Property Value

A SyncProviderPosition enumeration value that represents whether a provider is associated with the local or remote database.

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

See Also

Reference

DbSyncProvider Class
DbSyncProvider Members
Microsoft.Synchronization.Data Namespace