Compartir a través de


Subscriber.DeleteSubscriptions Method (NSApplication, String)

Deletes all of the subscriber's subscriptions in the specified subscription class of the Notification Services application.

Espacio de nombres: Microsoft.SqlServer.NotificationServices
Ensamblado: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Sintaxis

'Declaración
<ComVisibleAttribute(True)> _
Public Sub DeleteSubscriptions ( _
    nsApplication As NSApplication, _
    subscriptionClassName As String _
)
[ComVisibleAttribute(true)] 
public void DeleteSubscriptions (
    NSApplication nsApplication,
    string subscriptionClassName
)
[ComVisibleAttribute(true)] 
public:
virtual void DeleteSubscriptions (
    NSApplication^ nsApplication, 
    String^ subscriptionClassName
) sealed
/** @attribute ComVisibleAttribute(true) */ 
public final void DeleteSubscriptions (
    NSApplication nsApplication, 
    String subscriptionClassName
)
ComVisibleAttribute(true) 
public final function DeleteSubscriptions (
    nsApplication : NSApplication, 
    subscriptionClassName : String
)

Parámetros

  • nsApplication
    An NSApplication that represents the Notification Services application from which all subscriptions for this subscriber should be deleted.
  • subscriptionClassName
    A string containing the name of the subscription class from which all subscriptions for this subscriber are to be deleted.

Ejemplo

The following examples show how to use the DeleteSubscriptions method to delete all subscriptions in one subscription class of one Notification Services application for a subscriber:

Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim subscriptionClassName As String = "MySubscriptionClassName"

'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)

'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)

'Create a Subscriber object.
Dim mySubscriber As New Subscriber(myInstance)

'Set the subscriber ID, so that the
'correct subscriptions will be deleted.
mySubscriber.SubscriberId = "MySubscriberID"

'Delete subscriptions for a subscription class.
mySubscriber.DeleteSubscriptions(myApplication, subscriptionClassName)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string subscriptionClassName = "MySubscriptionClassName";

//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);

//Create an NSApplication object.
NSApplication myApplication = 
    new NSApplication(myInstance, applicationName);

//Create a Subscriber object.
Subscriber mySubscriber = new Subscriber(myInstance);

//Set the subscriber ID, so that the
//correct subscriptions will be deleted.
mySubscriber.SubscriberId = "MySubscriberID";

//Delete subscriptions for a subscription class.
mySubscriber.DeleteSubscriptions(
    myApplication, subscriptionClassName);

Seguridad para subprocesos

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

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

Subscriber Class
Subscriber Members
Microsoft.SqlServer.NotificationServices Namespace