共用方式為


SyncProviderPosition 屬性

取得或設定 SyncProviderPosition 列舉值,這個值表示提供者與本機或遠端資料庫相關聯。

命名空間:  Microsoft.Synchronization.Data
組件:  Microsoft.Synchronization.Data (在 Microsoft.Synchronization.Data.dll 中)

語法

'宣告
Public Property SyncProviderPosition As SyncProviderPosition
    Get
    Set
'用途
Dim instance As RelationalSyncProvider
Dim value As SyncProviderPosition

value = instance.SyncProviderPosition

instance.SyncProviderPosition = value
public SyncProviderPosition SyncProviderPosition { get; set; }
public:
property SyncProviderPosition SyncProviderPosition {
    SyncProviderPosition get ();
    void set (SyncProviderPosition value);
}
member SyncProviderPosition : SyncProviderPosition with get, set
function get SyncProviderPosition () : SyncProviderPosition
function set SyncProviderPosition (value : SyncProviderPosition)

屬性值

型別:Microsoft.Synchronization. . :: . .SyncProviderPosition
SyncProviderPosition 列舉值,這個值表示提供者與本機或遠端資料庫相關聯。

範例

下列程式碼範例會具現化本機和遠端提供者,然後呼叫為本文件所建立範例類別中的 SetupSyncProvider 方法。使用此方法,是為了能夠輕鬆為多個節點設定提供者。在此方法之內指定了一些提供者命令。如需有關這些命令的詳細資訊以及在完整範例內容中檢視此程式碼,請參閱 HOW TO:設定及執行共同作業同步處理 (非 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

請參閱

參考

RelationalSyncProvider類別

RelationalSyncProvider 成員

Microsoft.Synchronization.Data 命名空間