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.
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?
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!
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 =