Partilhar via


Dropping a Subscription

A Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) application can use the Replication object to drop an anonymous subscription and, optionally, delete the SQL Server Compact Edition database from the smart device.

Calling the DropSubscription Method

SQL Server Compact Edition applications use the Replication object to programmatically drop a subscription and, optionally, delete the database smart device. The application does this by creating the Replication object, setting the appropriate Replication object properties, and then calling the DropSubscription method. The examples in this topic show how you do this.

Multiple Subscriptions and the DropSubscription Method

Because SQL Server Compact Edition supports synchronizing a single database with multiple publications, you must consider the effects of multiple subscriptions when you drop a subscription with the DropSubscription method, especially if you are using the DropSubscription method to delete the database.

If you are using the DropSubscription method on a database with multiple subscriptions, you must set the Publisher, Publication, and PublisherDatabase properties before calling the DropSubscription method.

For more information about dropping a subscription, see How to: Drop a SQL Server Compact Edition Subscription (Programmatically).

See Also

Concepts

Supporting Multiple Subscriptions
Creating a Subscription
Reinitializing a Subscription (SQL Server Compact Edition)

Help and Information

Getting SQL Server Compact Edition Assistance