[Top] [All Lists]

Re: subscription object has not been initialized ?

Subject: Re: subscription object has not been initialized ?
From: Joe Webb
Date: Thu, 07 Apr 2005 14:35:15 -0500
Newsgroups: microsoft.public.sqlserver.notificationsvcs
Tarpan -

Are you initializing the instance and application objects first?

Here's is a snippet of C# code from a sample subscription management application. The full blown application is available for free download on my web site,, under the downloads section.
//Create an NSInstance object
NSInstance instance;
instance = new NSInstance(MyInstanceName);

//Create an NSApplication object
NSApplication app;
app = new NSApplication(instance, MyAppName);

//create a subscription object
Subscription newSubscription;
newSubscription = new Subscription(app, MySubscriptionClass);

Joe Webb
SQL Server MVP

Get up to speed quickly with SQLNS

tarpan wrote:

The NS API throws the following exeption:

Microsoft.SqlServer.NotificationServices.NSException: The subscription object has not been initialized. InstanceName: ELSInstance ApplicationName: ELS SubscriptionClassName: ELS_Bin_Level_CSubscription SubscriberId: Oleksiy SubscriptionId: 0
The code is:

Dim Subscription As New Subscription

Subscription.Initialize(NSApplication, SubscriptionClassName)
Subscription.SubscriberId = UserName

What is wrong?

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