ArcGIS Pro 2.9 API Reference Guide
GetDataset Method (ItemFactory)

ArcGIS.Desktop.Core Namespace > ItemFactory Class : GetDataset Method
The item to check.
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, Windows 8.1

See Also

Reference

ItemFactory Class
ItemFactory Members