[Top] [All Lists]

Re: How to verify if subscriber exists?

Subject: Re: How to verify if subscriber exists?
From: "TonyS"
Date: Thu, 23 Nov 2006 06:27:46 -0000
Newsgroups: microsoft.public.sqlserver.notificationsvcs
I thought I had posted this snippet that helps with your query

Tony S.
Public Function IsExistingSubscriber(ByVal subscriberId As String) As 

Dim Instance As New NSInstance(Me.sdm_InstName)

Dim Application As New NSApplication(Instance, Me.sdm_AppName)

If Not instance Is Nothing Then

Dim subscriber As Subscriber

Dim subscriberEnumeration As SubscriberEnumeration

subscriberEnumeration = New SubscriberEnumeration(instance)


subscriber = subscriberEnumeration(subscriberId)

Return True

Catch ex As IndexOutOfRangeException

IsExistingSubscriber = False

Catch ex As Exception

IsExistingSubscriber = False

End Try


Return False

End If

End Function

"Aleksey" <[email protected]> wrote in message 
news:[email protected]
> What is the right way to check if a subscriber exists already?
> Subscriber.Add() raises an error if the ID is already there, and
> SubscriberEnumeration raises an error if it is not there.
> How can I do that without errors? I cannot find a method or property for
> that...

<Prev in Thread] Current Thread [Next in Thread>