Subscriber.DeleteSubscriptions Method (NSApplication)
Deletes all of the subscriber's subscriptions in the specified Notification Services application.
Пространство имен: Microsoft.SqlServer.NotificationServices
Сборка: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Синтаксис
'Декларация
<ComVisibleAttribute(False)> _
Public Sub DeleteSubscriptions ( _
nsApplication As NSApplication _
)
[ComVisibleAttribute(false)]
public void DeleteSubscriptions (
NSApplication nsApplication
)
[ComVisibleAttribute(false)]
public:
void DeleteSubscriptions (
NSApplication^ nsApplication
)
/** @attribute ComVisibleAttribute(false) */
public void DeleteSubscriptions (
NSApplication nsApplication
)
ComVisibleAttribute(false)
public function DeleteSubscriptions (
nsApplication : NSApplication
)
Параметры
- nsApplication
An NSApplication that represents the Notification Services application from which all subscriptions for this subscriber should be deleted.
Пример
The following examples show how to use the DeleteSubscriptions method to delete all subscriptions in one Notification Services application for a subscriber:
Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
'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 an application.
mySubscriber.DeleteSubscriptions(myApplication)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
//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 an application.
mySubscriber.DeleteSubscriptions(myApplication);
Синхронизация потоков
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.
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
Subscriber Class
Subscriber Members
Microsoft.SqlServer.NotificationServices Namespace