Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCeSyncDescriptionBuilder.GetDescriptionForScope Method

Returns a DbSyncScopeDescription object that contains information about a scope that is defined for a SQL Server Compact database.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member GetDescriptionForScope(String, SqlCeConnection) Returns a DbSyncScopeDescription object that contains information about the specified scope that is defined for a SQL Server Compact database.
Public method Static member GetDescriptionForScope(String, String, SqlCeConnection) Returns a DbSyncScopeDescription object that contains information about the specified scope that is defined for a SQL Server Compact database.
Top

The following code example provisions a SQL Server database. Provisioning is based on scope information that is retrieved from a SQL Server Compact database by calling GetDescriptionForScope and specifying the scope name ("filtered_customer"), the optional object prefix name used in the SQL Server Compact database (in this case "Sync"), and the connection. SQL Server Compact databases do not support separate schemas, so we prefix the name of all synchronization-related objects with "Sync" so that they are easy to identify. For the SQL Server database, we specify the optional database schema in which Sync Framework stores synchronization objects (in this case "Sync", but the value is not required to match the object prefix). To view this code in the context of a complete example, see How To: Execute Database Synchronization (SQL Server).

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


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


Show:
© 2015 Microsoft