Export (0) Print
Expand All

Subscriber.Update Method

SQL Server 2000

Subscriber.Update Method

Updates the information in a subscriber record.

Public Sub Update() 

public void Update();

public: void Update();

public function Update();
Exception Type Condition
IndexOutOfRangeException The subscriber ID specified for the record to be updated does not match the subscriber ID of any subscriber records in the database.
NSException with an NSEventEnum.FailedToUpdateSubscriber argument The subscriber record could not be updated. Check the event log for further details.
NSException with an NSEventEnum.SubscribersDisabled argument The subscriber record is disabled. It must be enabled in order to be updated.

If the subscriber ID is set in a procedure, all subsequent updates is performed on the record identified by the subscriber ID that was set, and not on the record that was originally retrieved.


The following examples show how to use the Update method to modify subscriber information:

Dim instanceName As String = "MyInstanceName"

'Create an NSInstance object.
Dim myInstance As New Microsoft.SqlServer.NotificationServices.NSInstance(instanceName)

'Create a Subscriber object.
Dim mySubscriber As New Microsoft.SqlServer.NotificationServices.Subscriber(myInstance)

'Set the subscriber ID, so that the
'correct subscriber record will be updated.
mySubscriber.SubscriberId = txtID.Text

'Modify subscriber information.
mySubscriber.Enabled = false

'Update the subscriber record.

string instanceName = "MyInstanceName";

//Create an NSInstance object.
Microsoft.SqlServer.NotificationServices.NSInstance myInstance = new Microsoft.SqlServer.NotificationServices.NSInstance(instanceName);

//Create a Subscriber object.
Microsoft.SqlServer.NotificationServices.Subscriber mySubscriber = new Microsoft.SqlServer.NotificationServices.Subscriber(myInstance);

//Set the subscriber ID, so that the
//correct subscriber record will be updated.
mySubscriber.SubscriberId = txtID.Text;

//Modify subscriber information.
mySubscriber.Enabled = false;

//Update the subscriber record.


Platforms: Windows 2000 Server, Windows 2000 Advanced Server, Windows 2000 Data Center Server, Windows XP Professional

See Also
Subscriber Members

Microsoft.SqlServer.NotificationServices Namespace

© 2015 Microsoft