Share via


DataViewHierarchyAccessor.DropObjectNode Method

Drops an existing node that represents an object from the data source from the data view hierarchy.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Public Sub DropObjectNode ( _
    itemId As Integer _
)
public void DropObjectNode(
    int itemId
)
public:
void DropObjectNode(
    int itemId
)
member DropObjectNode : 
        itemId:int -> unit
public function DropObjectNode(
    itemId : int
)

Parameters

  • itemId
    Type: System.Int32

    The item ID of the node to be dropped.

Exceptions

Exception Condition
ArgumentException

The itemId parameter is invalid or represents a non-object based node.

Remarks

A DDEX provider should call this method in two scenarios.

The first is when implementing some form of "New <object>" command (for example, a "New Table" command), and after the designer has been brought up, the user decides to cancel the creation of this new object. In this scenario, the node created by calling CreateObjectNode should be dropped.

The second case is when implementing some form of "Delete <object>" command, where a provider will want to perform the delete operation on the data source and then request that the node be removed from the data view hierarchy.

It is only possible to create or drop nodes that represent an object on the data source. It is not possible to dynamically modify the format of the hierarchy by creating or dropping static nodes such as a "Tables" or "Views" node.

.NET Framework Security

See Also

Reference

DataViewHierarchyAccessor Class

Microsoft.VisualStudio.Data Namespace