# OpcClient.DeleteNodes Method

> Reference: Deletes one or more nodes from the address space hierarchy using the commands specified.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClient</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcClient Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

<span class="api-meta">4 overloads</span>

| Overload | Description |
|---|---|
| [DeleteNodes(IEnumerable&lt;OpcDeleteNode&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/deletenodes#deletenodes-system-collections-generic-ienumerable-of-opc-uafx-opcdeletenode)<span class="api-meta">since v2.7</span> | Deletes one or more nodes from the address space hierarchy using the `commands` specified. |
| [DeleteNodes(params OpcDeleteNode\[\])](#deletenodes-opc-uafx-opcdeletenode-array)<span class="api-meta">since v2.7</span> | Deletes one or more nodes from the address space hierarchy using the `commands` specified. |
| [DeleteNodes(IEnumerable&lt;OpcNodeId&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/deletenodes#deletenodes-system-collections-generic-ienumerable-of-opc-uafx-opcnodeid) | Deletes one or more nodes from the address space hierarchy using the identifiers of the nodes which shall be deleted including the references where the node acts as the source and as the target of the reference. |
| [DeleteNodes(params OpcNodeId\[\])](#deletenodes-opc-uafx-opcnodeid-array) | Deletes one or more nodes from the address space hierarchy using the identifiers of the nodes which shall be deleted including the references where the node acts as the source and as the target of the reference. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) and [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations). |

## DeleteNodes(IEnumerable&lt;OpcDeleteNode&gt;)

<span class="api-meta">since v2.7</span>

Deletes one or more nodes from the address space hierarchy using the `commands` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcStatusCollection DeleteNodes(IEnumerable<OpcDeleteNode> commands)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DeleteNodes(
    commands As IEnumerable(Of OpcDeleteNode)) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/)&gt; | A sequence of [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) instances to process. |

**Returns**

[OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/)

An instance of the [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) class which contains the information about the outcome of each processed command.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence or one of its items is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The delete node service is currently not supported, especially using the `commands` specified. |

**Remarks**

Known results for the `commands` specified are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |
| [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights) | For more details see [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights). |
| [UncertainReferenceNotDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferencenotdeleted) | The server was not able to delete all target references. |

## DeleteNodes(params OpcDeleteNode\[\])

<span class="api-meta">since v2.7</span>

Deletes one or more nodes from the address space hierarchy using the `commands` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcStatusCollection DeleteNodes(params OpcDeleteNode[] commands)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DeleteNodes(
    ParamArray commands As OpcDeleteNode()) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | params [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/)[] | An array of [OpcDeleteNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdeletenode/) instances to process. |

**Returns**

[OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/)

An instance of the [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) class which contains the information about the outcome of each processed command.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence or one of its items is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The delete node service is currently not supported, especially using the `commands` specified. |

**Remarks**

Known results for the `commands` specified are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |
| [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights) | For more details see [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights). |
| [UncertainReferenceNotDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferencenotdeleted) | The server was not able to delete all target references. |

## DeleteNodes(IEnumerable&lt;OpcNodeId&gt;)

Deletes one or more nodes from the address space hierarchy using the identifiers of the nodes which shall be deleted including the references where the node acts as the source and as the target of the reference.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcStatusCollection DeleteNodes(IEnumerable<OpcNodeId> nodeIds)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DeleteNodes(
    nodeIds As IEnumerable(Of OpcNodeId)) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeIds` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)&gt; | A sequence of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances through that the nodes to delete can be identified and accessed. |

**Returns**

[OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/)

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | One of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances in `nodeIds` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeIds` is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The delete node service is currently not supported, especially using the parameters specified. |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |
| [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights) | For more details see [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights). |
| [UncertainReferenceNotDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferencenotdeleted) | The server was not able to delete all target references. |

## DeleteNodes(params OpcNodeId\[\])

Deletes one or more nodes from the address space hierarchy using the identifiers of the nodes which shall be deleted including the references where the node acts as the source and as the target of the reference.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcStatusCollection DeleteNodes(params OpcNodeId[] nodeIds)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DeleteNodes(
    ParamArray nodeIds As OpcNodeId()) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeIds` | params [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)[] | An array of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances through that the nodes to delete can be identified and accessed. |

**Returns**

[OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/)

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | One of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances in `nodeIds` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeIds` is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The delete node service is currently not supported, especially using the parameters specified. |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |
| [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights) | For more details see [BadNoDeleteRights](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeleterights). |
| [UncertainReferenceNotDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#uncertainreferencenotdeleted) | The server was not able to delete all target references. |
