Get dataset names

06-15-2021 08:22 AM
New Contributor III

I can get layer name from active map.  Now i need to get database name.  I can get datastore from a basic feature layer object and then get database from the datastore.  I need to get dataset names not table names.

Please help.


0 Kudos
3 Replies
Esri Regular Contributor

What do you mean by "database name"?  File and mobile geodatabases have a path, feature service geodatabases have a service URL, and enterprise geodatabases have a collection of connection properties.  What is it you are looking for?


0 Kudos
New Contributor III

It is an Oracle SDE database.  Sorry I was not clear.  I will try the code  CarlesMacleod  displayed below and see how it goes.

In our SDE database,  we have many datasets.  I want to be able to list the dataset names and allow user to select ONE dataset and loop through the feature layers in it.

Thank you all!

0 Kudos
Esri Contributor

Rich's question notwithstanding and assuming it is the names of the datasets within a gdb u are after, this snippet might help:


note the line in question: Call "GetName()" on each definition to get the dataset name.

IReadOnlyList<FeatureDatasetDefinition> featureDatasetDefinitions = 


0 Kudos