Select to view content in your preferred language

Enumerating layers inside a GDB or SDE database?

664
2
Jump to solution
04-05-2013 07:19 AM
Labels (1)
GeorgeFaraj
Frequent Contributor
I want to allow the user to browse to select a Geodatabase that they want to load into my app. When they select the GDB folder, I want to list the layers that are available, and have the user select which ones he wants to load.

I need this for layers in an SDE database as well.

The sample code that I've found to do this always has the layer name hardcoded.

Can someone point me in the right direction?
0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor
Hi,

Apologies for the delay in responding. You have spotted a gap in the API which we hope to resolve in a future release - but for now you have two options:

#1. Use the Geoprocessor task in conjunction with a GPK based on a Python script which provides this functionality. This would be my preferred approach - using Arcpy and Python gives you massive flexibility. I've written up a sample of this and attached to the post.

#2. Use the File Geodatabase API. This probably provides the functionality you require via a .NET API - but would be a hybrid solution of the ArcGIS Runtime SDK for WPF and the File GDB API.


Cheers

Mike

View solution in original post

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

Apologies for the delay in responding. You have spotted a gap in the API which we hope to resolve in a future release - but for now you have two options:

#1. Use the Geoprocessor task in conjunction with a GPK based on a Python script which provides this functionality. This would be my preferred approach - using Arcpy and Python gives you massive flexibility. I've written up a sample of this and attached to the post.

#2. Use the File Geodatabase API. This probably provides the functionality you require via a .NET API - but would be a hybrid solution of the ArcGIS Runtime SDK for WPF and the File GDB API.


Cheers

Mike
0 Kudos
GeorgeFaraj
Frequent Contributor
Thank you, Mike.
0 Kudos