microsoft.public.sqlserver.notificationsvcs
[Top] [All Lists]

Re: NS API

Subject: Re: NS API
From: "Wayne"
Date: Thu, 11 Aug 2005 15:37:31 -0400
Newsgroups: microsoft.public.sqlserver.notificationsvcs
Also meant to mention we are using SQL 2005 June CTP.

Thanks
Wayne


"Wayne" <[email protected]> wrote in message 
news:[email protected]
> That's closer to what I was looking for, what I really need is the 
> following:
>
> 1) how to retrieve a single subscriber
>    I have the subscriber ID
> 2) how to retrieve a single subscription
>    I have the subscription ID
>
> Thanks
> Wayne
>
>
> "Joe Webb" <[email protected]> wrote in message 
> news:[email protected]
>> Hi Wayne -
>>
>> The only property that you can really maintain for a subscriber is the
>> enabled property. BOL has an example of how to do that.
>>
>> The following code retrieves the subscriptions for a single subscriber
>> without having to first retrieve the subscriber. Note, that this does
>> *not* populate the Subscriber object so a subsequent evaluation of the
>> Enabled property will be inaccurate (it'll show the default value of
>> true regardless of the actual state of the subscriber).
>>
>> private SubscriptionEnumeration GetSubscriptions(string sId)
>> {
>> //Create an NSInstance and NSApplication object
>> NSInstance instance = getNSInstance();
>> NSApplication app = getNSApplication(instance);
>>
>> //create a subscriber object
>> Subscriber subscriber = new Subscriber(instance);
>> subscriber.SubscriberId = sId;
>>
>> //get the SubscriptionClassName
>> string subClass = "mySubscriptionName";
>>
>> //get the subscriptions
>> return subscriber.GetSubscriptions(app, subClass);
>>
>> }
>>
>>
>> HTH... Let me know if I've misinterpreted your post.
>>
>> -- 
>> Joe Webb
>> SQL Server MVP
>>
>>
>> ~~~
>> Get up to speed quickly with SQLNS
>> http://www.amazon.com/exec/obidos/tg/detail/-/0972688811
>>
>> I support PASS, the Professional Association for SQL Server.
>> (www.sqlpass.org)
>>
>>
>> On Tue, 9 Aug 2005 09:02:57 -0400, "Wayne" <[email protected]>
>> wrote:
>>
>>>I'm trying to updated subscriptions for a single subscriber, so far all 
>>>is
>>>working well. However, I was wondering is there a way to pull back just 
>>>the
>>>sing subscriber? Currently I am doing the following:
>>>
>>>new SubscriberEnumeration(nsInstance)[subscriberId];
>>>
>>>As I understand from the help the new SubscriberEnumeration(nsInstance)
>>>creates a collection that contains all the subscribers in the database. 
>>>This
>>>seems to be a bit inefficient, I'd like to just retrieve the subscriber
>>>based on the subscriberId.
>
> 



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