ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data Namespace / RowCursor Class / Current Property
Example

In This Topic
    Current Property (RowCursor)
    In This Topic
    Gets the current Row in this RowCursor.
    Syntax
    Public ReadOnly Property Current As Row
    public Row Current {get;}
    Remarks
    If the cursor has passed the end of the collection (i.e., when MoveNext returns false), null is returned. If a valid Row is returned by this property, it should be Disposed.
    Example
    Searching a Table using QueryFilter
    {
      await QueuedTask.Run(() =>
      {
        try
        {
          using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
          using (Table table = geodatabase.OpenDataset<Table>("EmployeeInfo"))
          {
            QueryFilter queryFilter = new QueryFilter
            {
              WhereClause = "COSTCTRN = 'Information Technology'",
              SubFields = "KNOWNAS, OFFICE, LOCATION",
              PostfixClause = "ORDER BY OFFICE"
            };
    
            using (RowCursor rowCursor = table.Search(queryFilter, false))
            {
              while (rowCursor.MoveNext())
              {
                using (Row row = rowCursor.Current)
                {
                  string location = Convert.ToString(row["LOCATION"]);
                  string knownAs = Convert.ToString(row["KNOWNAS"]);
                }
              }
            }
          }
        }
        catch (GeodatabaseFieldException fieldException)
        {
          // One of the fields in the where clause might not exist. There are multiple ways this can be handled:
          // Handle error appropriately
        }
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also