Return Value
The data store of this dataset.
| Exception | Description |
|---|---|
| System.InvalidOperationException | This dataset does not have an associated data store because it is either invalid, virtual or currently not supported. |
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
await QueuedTask.Run(() =>
{
IEnumerable<Layer> layers =
MapView.Active.Map.Layers.Where(layer => layer is FeatureLayer);
foreach (FeatureLayer featureLayer in layers)
{
using (Table table = featureLayer.GetTable())
using (Datastore datastore = table.GetDatastore())
{
if (datastore is UnknownDatastore)
continue;
Geodatabase geodatabase = datastore as Geodatabase;
}
}
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)