You can programmatically access the replication features of Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) through a Microsoft Visual Studio® .NET or Microsoft eMbedded Visual Tools application running on a Microsoft Windows CE-based device. Replication features that allow you to create, synchronize and manage replicated SQL Server data are supported between SQL Server CE and SQL Server 2000 Service Pack 1 or higher.
To program SQL Server CE replication functionality in a Visual Studio .NET development environment, use the .NET Compact Framework Data Provider for SQL Server CE, which provides the System.Data.SqlServerCe.SqlCeReplication class. For information about the methods and properties of the SqlCeReplication class and other classes in the System.Data.SqlServerCe namespace, see .NET Compact Framework Data Providers.
To program replication in the eMbedded Visual Tools development environment, use the SQL Server CE ActiveX® Control Replication object. The following topics in this section describe the concepts for building Windows CE-based applications by using the SQL Server CE Replication object with eMbedded Visual Tools and the SqlCeReplication class with the .NET Compact Framework Data Provider for SQL Server CE:
- Creating a Subscription.
- Synchronizing a Subscription
- Reinitializing a Subscription
- Dropping a Subscription
This section also contains a programmer's reference that describes the methods and properties of the Replication object for the Microsoft eMbedded Visual Tools environment. For more information, see Replication Programmer's Reference for eMbedded Visual Tools.
Automating Management of Replication Processes
Users should be shielded from the details of replication by automatically subscribing to and downloading any publications the application needs. An application should use the Replication object to initiate database synchronization whenever synchronization is required. For example, an application might trigger synchronization when it detects that the Windows CE-based device is reconnected to the network, when the application has updated critical database information, when the user requests synchronization, or when a certain time period has elapsed. If an application is deleted from the Windows CE-based device, it should delete any Subscriber databases that it no longer needs from the device.
For more information, see "Programming the SQL Merge ActiveX Control" and "Replication ActiveX Control Interface Reference" in SQL Server Books Online.