SqlSyncDescriptionBuilder クラス
同期に関係する SQL Server データベースのスコープ情報およびテーブル情報を表します。
名前空間: Microsoft.Synchronization.Data.SqlServer
アセンブリ: Microsoft.Synchronization.Data.SqlServer (Microsoft.Synchronization.Data.SqlServer.dll 内)
構文
'宣言
Public NotInheritable Class SqlSyncDescriptionBuilder
'使用
public static class SqlSyncDescriptionBuilder
public ref class SqlSyncDescriptionBuilder abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type SqlSyncDescriptionBuilder = class end
public final class SqlSyncDescriptionBuilder
例
次のコード例では、filtered_customer という名前のスコープを記述し、このスコープに 2 つのテーブル Customer と CustomerContact を追加します。このテーブルは既にサーバー データベースに存在しているので、GetDescriptionForTable メソッドを使用して、サーバー データベースからスキーマを取得します。Customer テーブルのすべての列が含まれますが、CustomerContact テーブルの列は 2 つしか含まれません。完全なコンテキスト例でこのコードを表示するには、「方法: データベース同期を構成して実行する (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)
継承階層
System. . :: . .Object
Microsoft.Synchronization.Data.SqlServer..::..SqlSyncDescriptionBuilder
スレッド セーフ
この型の public static (Visual Basic では Shared) のメンバーはスレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。