SqlCeSyncScopeProvisioning Class

Represents the provisioning of a SQL Server Compact database for a particular scope that is represented by a DbSyncScopeDescription object.

Inheritance Hierarchy

System.Object
  Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncScopeProvisioning

Namespace:  Microsoft.Synchronization.Data.SqlServerCe
Assembly:  Microsoft.Synchronization.Data.SqlServerCe (in Microsoft.Synchronization.Data.SqlServerCe.dll)

Syntax

'Declaration
Public Class SqlCeSyncScopeProvisioning
'Usage
Dim instance As SqlCeSyncScopeProvisioning
public class SqlCeSyncScopeProvisioning
public ref class SqlCeSyncScopeProvisioning
type SqlCeSyncScopeProvisioning =  class end
public class SqlCeSyncScopeProvisioning

The SqlCeSyncScopeProvisioning type exposes the following members.

Constructors

  Name Description
Public method SqlCeSyncScopeProvisioning() Obsolete. Initializes a new instance of the SqlCeSyncScopeProvisioning class by using default values.
Public method SqlCeSyncScopeProvisioning(SqlCeConnection) Initializes a new instance of the SqlCeSyncScopeProvisioning class with the specified connection.
Public method SqlCeSyncScopeProvisioning(DbSyncScopeDescription) Obsolete. Initializes a new instance of the SqlCeSyncScopeProvisioning class for the specified scope.
Public method SqlCeSyncScopeProvisioning(SqlCeConnection, DbSyncScopeDescription) Initializes a new instance of the SqlCeSyncScopeProvisioning class with the specified connection and scope description.

Top

Properties

  Name Description
Public property ObjectPrefix Gets or sets the optional prefix that is used to identify objects that Sync Framework creates.
Public property ScopeName Gets the name of the scope that this object represents.
Public property Tables Gets a collection of SqlCeSyncTableProvisioning objects that each represent the provisioning of a database table.
Public property UserComment Gets or sets the user comment about the scope.

Top

Methods

  Name Description
Public method Apply() Applies the provisioning script over the connection that was specified in the constructor.
Public method Apply(SqlCeConnection) Obsolete. Applies the provisioning script to a SQL Server Compact database over the specified connection.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method PopulateFromScopeDescription Sets the scope description from which the database should be provisioned.
Public method ScopeExists(String) Indicates whether the specified scope exists in the database by using the connection previously specified in the constructor.
Public method ScopeExists(String, SqlCeConnection) Obsolete. Returns whether the specified scope exists.
Public method SetCreateTableDefault Sets whether to create base tables when a scope is configured.
Public method ToString (Inherited from Object.)

Top

Examples

The following code example provisions a SQL Server Compact database. Provisioning is based on scope information that is retrieved from the server by calling GetDescriptionForScope and specifying the scope name ("filtered_customer"), the connection, the object prefix name used on the server (null), and the optional database schema in which Sync Framework stores synchronization objects (in this case "Sync"). 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. To view this code in the context of a complete example, see How To: Execute Database Synchronization (SQL Server).

DbSyncScopeDescription clientSqlCe1Desc = SqlSyncDescriptionBuilder.GetDescriptionForScope("filtered_customer", null, "Sync", serverConn);
SqlCeSyncScopeProvisioning clientSqlCe1Config = new SqlCeSyncScopeProvisioning(clientSqlCe1Conn, clientSqlCe1Desc);
clientSqlCe1Config.ObjectPrefix = "Sync";
clientSqlCe1Config.Apply();
Dim clientSqlCe1Desc As DbSyncScopeDescription = _
    SqlSyncDescriptionBuilder.GetDescriptionForScope("filtered_customer", Nothing, "Sync", serverConn)
Dim clientSqlCe1Config As New SqlCeSyncScopeProvisioning(clientSqlCe1Conn, clientSqlCe1Desc)
clientSqlCe1Config.ObjectPrefix = "Sync"
clientSqlCe1Config.Apply()

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Synchronization.Data.SqlServerCe Namespace