I am Obtaining Featureclass names From SDE Geodatabase using following code:
public async Task ObtainingDefinitionsFromGeodatabase() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) { IReadOnlyList<FeatureClassDefinition> enterpriseDefinitions = geodatabase.GetDefinitions<FeatureClassDefinition>();
List<string> featureclassList = enterpriseDefinitions.Select(x => x.GetName()).ToList(); } }); }
But featureclassList is populated with different feature class names along with actual feature class names contained in the database. In Catalog, it is showing correct feature classes.
I am using ArcGIS pro SDK 3.1 and Oracle SDE connection. What's wrong in the above code @Wolf, @GKmieliauskas , @UmaHarano ?
Solved! Go to Solution.
@SumitMishra_016 I am curious to know what your expectations were and what you are seeing. Could you please elaborate?
Thanks for the reply @Aashis,
When opening the sde connection in catalog, it shows correct Enterprise Geodatabase Feature Classes which are associated with the username provide in the sde connection.
But when I am using
geodatabase.GetDefinitions<FeatureClassDefinition>()
it shows other Enterprise Geodatabase Feature Classes which are not associated with the username provide in the sde connection
@SumitMishra_016 , it seems like the catalog's view-only behavior for the owner, and the API shows everything the user has access to.
Hi @Aashis,
List only object owned by connecting user was not checked but it was still showing correct feature classes.
Can I use this(List only object owned by connecting user) in code?