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. |
public async Task ObtainingGeodatabaseFromFeatureLayer() { IEnumerable<Layer> layers = MapView.Active.Map.Layers.Where(layer => layer is FeatureLayer); await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { 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, Windows 10, Windows 8.1