共用方式為


ScopeName 屬性

設定要同步處理的範圍名稱,這個範圍是具有選擇性篩選的邏輯資料表群組。

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

語法

'宣告
Public Overrides WriteOnly Property ScopeName As String
    Set
'用途
Dim instance As SqlSyncProvider
Dim value As String

instance.ScopeName = value
public override string ScopeName { set; }
public:
virtual property String^ ScopeName {
    void set (String^ value) override;
}
abstract ScopeName : string with get, set
override ScopeName : string with get, set
override function set ScopeName (value : String)

屬性值

型別:System. . :: . .String
要同步處理的範圍名稱。

範例

下列程式碼範例是使用 DbSyncScopeDescription 物件來指定 SqlSyncProvider 物件的範圍,而不是直接設定 ScopeName。若要在完整範例的內容中檢視這段程式碼,請參閱 HOW TO:設定及執行資料庫同步處理 (SQL Server)

DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription("filtered_customer");

// Definition for Customer.
DbSyncTableDescription customerDescription =
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.Customer", serverConn);

scopeDesc.Tables.Add(customerDescription);

// Definition for CustomerContact, including the list of columns to include.
Collection<string> columnsToInclude = new Collection<string>();
columnsToInclude.Add("CustomerId");
columnsToInclude.Add("PhoneType");
DbSyncTableDescription customerContactDescription =
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.CustomerContact", columnsToInclude, serverConn);

scopeDesc.Tables.Add(customerContactDescription);
Dim scopeDesc As New DbSyncScopeDescription("filtered_customer")

' Definition for Customer. 
Dim customerDescription As DbSyncTableDescription = _
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.Customer", serverConn)

scopeDesc.Tables.Add(customerDescription)


' Definition for CustomerContact, including the list of columns to include. 
Dim columnsToInclude As New Collection(Of String)()
columnsToInclude.Add("CustomerId")
columnsToInclude.Add("PhoneType")
Dim customerContactDescription As DbSyncTableDescription = _
    SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.CustomerContact", columnsToInclude, serverConn)

scopeDesc.Tables.Add(customerContactDescription)

請參閱

參考

SqlSyncProvider類別

SqlSyncProvider 成員

Microsoft.Synchronization.Data.SqlServer 命名空間