Monday, February 20, 2012

Null Instance

So I have a little snippet of code as follows:

_nsServer = smo.Server(nsServerName);
_notificationServices = _nsServer.NotificationServices;
_nmoInstance = _notificationServices.Instances[instanceName];
_nmoApplication = _nmoInstance.Applications[applicationName];

This is in a class that's in a library. When I consume it with a console app, everything seems to work fine, but now I'm trying to wrap it in a web service, and I'm running into a lot of issues. Under the web service, after I initialize _nmoInstance in the above code, it's still null. In fact, the Instances property of _notificationServices is an empty collection. Anyone know why that might be? I have a feeling it might be DB permissions related, but I can't pin it down. For the record, I've granted access to the Network Service account for the database of the instance in question, and all the strings (nsServerName, instanceName, applicationName) have the correct values.

Thanks in advance,

-Francis

Never mind, was a DB permissions thing. I've got to narrow down exactly what I needed, but I've got it working now.

No comments:

Post a Comment