Share via


SqlSyncScopeProvisioning.ObjectSchema 属性

获取或设置 Sync Framework 创建对象所采用的数据库架构。

命名空间: Microsoft.Synchronization.Data.SqlServer
程序集: Microsoft.Synchronization.Data.SqlServer(在 microsoft.synchronization.data.sqlserver.dll 中)

语法

声明
Public Property ObjectSchema As String
用法
Dim instance As SqlSyncScopeProvisioning
Dim value As String

value = instance.ObjectSchema

instance.ObjectSchema = value
public string ObjectSchema { get; set; }
public:
property String^ ObjectSchema {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_ObjectSchema ()

/** @property */
public void set_ObjectSchema (String value)
public function get ObjectSchema () : String

public function set ObjectSchema (value : String)

属性值

Sync Framework 创建对象所采用的数据库架构。

示例

下面的代码示例设置一个 SQL Server 数据库。设置基于作用域信息,这些信息是通过调用 GetDescriptionForScope 和指定作用域名称(“filtered_customer"”)、SQL Server Compact 数据库中使用的可选对象前缀名称(在此情况下为“"Sync"”)以及连接从 SQL Server Compact 数据库检索的。SQL Server Compact 数据库不支持单独的架构,因此我们在所有与同步相关的对象之前加上前缀 "Sync",以便它们易于标识。对于 SQL Server 数据库,我们指定可选数据库架构(Sync Framework 在其中存储同步对象,在此情况下为 "Sync",但不要求值与对象前缀匹配)。若要在完整示例上下文中查看此代码,请参见如何配置和执行协作同步 (SQL Server)

DbSyncScopeDescription clientSqlDesc = SqlCeSyncDescriptionBuilder.GetDescriptionForScope("filtered_customer", "Sync", clientSqlCe1Conn);
SqlSyncScopeProvisioning clientSqlConfig = new SqlSyncScopeProvisioning(clientSqlDesc);
clientSqlConfig.ObjectSchema = "Sync";
clientSqlConfig.Apply(clientSqlConn);
Dim clientSqlDesc As DbSyncScopeDescription = _
    SqlCeSyncDescriptionBuilder.GetDescriptionForScope("filtered_customer", "Sync", clientSqlCe1Conn)
Dim clientSqlConfig As New SqlSyncScopeProvisioning(clientSqlDesc)
clientSqlConfig.ObjectSchema = "Sync"
clientSqlConfig.Apply(clientSqlConn)

请参阅

参考

SqlSyncScopeProvisioning 类
SqlSyncScopeProvisioning 成员
Microsoft.Synchronization.Data.SqlServer 命名空间