ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / Row Class / GetFields Method
Example

In This Topic
    GetFields Method (Row)
    In This Topic
    Gets a IReadOnlyList containing the fields of the row. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public IReadOnlyList<Field> GetFields()
    Public Function GetFields() As IReadOnlyList(Of Field)

    Return Value

    A IReadOnlyList containing the fields of the row.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    Example
    Evaluating a QueryDef on a Join using WHERE Clause
    public async Task JoiningWithWhereQueryDef()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file"))))
        {
          QueryDef municipalEmergencyFacilitiesQueryDef = new QueryDef
          {
            SubFields = "EmergencyFacility.OBJECTID, EmergencyFacility.Shape, EmergencyFacility.FACILITYID, FacilitySite.FACILITYID, FacilitySite.FCODE",
            Tables = "EmergencyFacility, FacilitySite",
            WhereClause = "EmergencyFacility.FACNAME = FacilitySite.NAME AND EmergencyFacility.JURISDICT = 'Municipal'",
          };
    
          using (RowCursor rowCursor = geodatabase.Evaluate(municipalEmergencyFacilitiesQueryDef, false))
          {
            while (rowCursor.MoveNext())
            {
              using (Row row = rowCursor.Current)
              {
                Feature feature = row as Feature;
                Geometry shape = feature.GetShape();
    
                long objectID = Convert.ToInt64(row["EmergencyFacility.OBJECTID"]);
                String featureCode = Convert.ToString(row["FacilitySite.FCODE"]);
    
                IReadOnlyList<Field> fields = feature.GetFields(); //Contains one ArcGIS.Core.Data.Field objects for every subfield
              }
            }
          }
        }
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also