PROBLEM

Feature editing fails in an editable layer

Last Published: April 25, 2020

Description

When editing layers, features from an editable layer are not editable.

Cause

When using query filter, only a subset of fields contained in the feature layer is returned. For example:

Code:

using (FeatureDataReader reader = featureLayer.GetDataReader(new QueryFilter(new Envelope(e.MapCoordinate,
map1.ToMap(3),map1.ToMap(3)), EsriGeometricRelationship.Intersect),"tempfield", featureLayer.GeometryColumnName))
{
if (reader.Read())
{
reader.SetInt32(reader.GetOrdinal("tempfield"), 1); // throws an exception
reader.Update();
}
}

Solution or Workaround

To avoid this problem, do not restrict attribute fields to be returned within a query. For example:

Code:

using (FeatureDataReader reader = featureLayer.GetDataReader(new QueryFilter(new Envelope(e.MapCoordinate,
map1.ToMap(3),map1.ToMap(3)), EsriGeometricRelationship.Intersect)))
{
if (reader.Read())
{
reader.SetInt32(reader.GetOrdinal("tempfield"), 1);
reader.Update();
}
}

    Article ID: 000009048

    Software:
    • ArcGIS Server

    Receive notifications and find solutions for new or common issues

    Get summarized answers and video solutions from our new AI chatbot.

    Download the Esri Support App

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options