ArcGIS SDK Pro C#: How to get SDE feature layer's field

569
1
Jump to solution
01-27-2022 07:01 AM
JadedEarth
Occasional Contributor

Hi,

How do I get the fields of a feature layer coming from an SDE geotabase connection?

I have this in my task:

 

await QueuedTask.Run(() =>
{
    Layer lyr = LayerFactory.Instance.CreateLayer(uri, MapView.Active.Map, index, lyrName);
});

 

 

Appreciate any help.

0 Kudos
1 Solution

Accepted Solutions
Aashis
by Esri Contributor
Esri Contributor
      await QueuedTask.Run(() =>
      {
        Layer lyr = LayerFactory.Instance.CreateLayer(uri, MapView.Active.Map, index, lyrName);

        if (lyr is FeatureLayer featureLayer)
        {
          IReadOnlyList<Field> fields = featureLayer.GetFeatureClass().GetDefinition().GetFields(); // Get all fields
        }

      });

View solution in original post

0 Kudos
1 Reply
Aashis
by Esri Contributor
Esri Contributor
      await QueuedTask.Run(() =>
      {
        Layer lyr = LayerFactory.Instance.CreateLayer(uri, MapView.Active.Map, index, lyrName);

        if (lyr is FeatureLayer featureLayer)
        {
          IReadOnlyList<Field> fields = featureLayer.GetFeatureClass().GetDefinition().GetFields(); // Get all fields
        }

      });
0 Kudos