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

    Get support with AI

    Resolve your issue quickly with the Esri Support AI Chatbot.

    Start chatting now

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Start chatting now

    Go to download options