ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Core Namespace / ItemFactory Class / GetDataset Method
The item to check.

In This Topic
    GetDataset Method (ItemFactory)
    In This Topic
    Gets the ArcGIS.Core.Data.Dataset associated with the item corresponding to Item.Path. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Dataset GetDataset( 
       Item item
    )
    Public Function GetDataset( _
       ByVal item As Item _
    ) As Dataset

    Parameters

    item
    The item to check.

    Return Value

    A specific ArcGIS.Core.Data.Dataset (e.g., ArcGIS.Core.Data.FeatureClass) associated with the item. A NotSupportedException will be thrown if the dataset cannot be determined for the item. Use CanGetDataset to determine if the dataset can be retrieved before calling this.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    This method or property must be called within the lambda passed to QueuedTask.Run
    The dataset cannot be determined for this item. Check CanGetDataset prior to calling this.
    item is null.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also