.NET Based OPC UA Client/Server SDK
Manage Subscription – Delete Subscription


A session and a subscription with the server must be established.


The following dialog shows an example dialog to delete an existing subcription. Press the button “Show Code” to display the corresponding code, and the button “Help” to show this documentation page.


The state of the current subscription is shown in the field at “Subscription State”. At pressing the button “Delete”, the subscription and all of its monitored items are deleted. The field “Subscription State” now shows the status “Deleted”. Check the box in front of “Use Asynchronous Pattern” to call “BeginDelete” instead of “Delete”.


Sample Code

The following code deletes an existing subscription and all of its monitored items.

// get the current session from the parent form.
Session session = m_parent.Session;
// nothing to do if no session.
if (session == null)
// delete subscription (10s timeout).
m_subscription.Delete(new RequestSettings() { OperationTimeout = 10000 });
// up date display.
CurrentStateTB.Text = m_subscription.ConnectionStatus.ToString();
catch (Exception exception)
ExceptionDlg.ShowInnerException(this.Text, exception);
Cursor = Cursors.Default;