Updating a feature class that is part of a network dataset

2801
2
12-21-2010 12:58 AM
AlexandreHirzel
New Contributor III
Hello,

I am trying to update a field of a feature class that is part of network dataset (inside a file geodatabase).

The code below is supposed to take a feature class (netFC), query for a feature given by its OID, and then update one of its field (idx) by assigning it a new value (disID). It works well up to the line "feature.store()" where it generates this exception: "The logical network is of an older version and does not support the requested functionality."

I am using ArcGIS 10 and the network dataset was built with ArcGIS 10 too. This method is part of a standalone application using ArcGIS Engine.

Please can you tell me how to solve this issue, or what I am doing wrong?

  private void setDisID(IFeatureClass netFC, int oid, String oidField, int idx, int disID)throws Exception{
    IQueryFilter queryFilter = new QueryFilter();
    queryFilter.setWhereClause(oidField + " = " + oid);
    IWorkspace ws = new IWorkspaceProxy(netFC.getFeatureDataset().getWorkspace());
    IWorkspaceEdit wse = new IWorkspaceEditProxy(ws);
    wse.startEditing(true);
    wse.startEditOperation();

    IFeatureCursor cursor = netFC.IFeatureClass_update(queryFilter, false);
    IFeature feature = cursor.nextFeature();
    feature.setValue(idx, disID);
    feature.store();

    Cleaner.release(cursor);
    wse.stopEditOperation();
    wse.stopEditing(true);
  }


                Alexandre
0 Kudos
2 Replies
AlexandreHirzel
New Contributor III
Any pointer would be welcome.

Another error message I get at this point is: The supplied command does not exist in command pool in 'esriControls.CommandPool.1. What does it mean?

Could at the very least someone check if my code is correct (and thus I have to look in another direction) or if I am doing some mistake. I have tried to derive it from ESRI samples, but there are couple of points that may be different because the Feature Class is part of Network Dataset (it is a polyline FC, forming the edges of the network).

Any help will be appreciated as I am fairly new to Java and COM programming.
0 Kudos
DrewDowling
Occasional Contributor III

Did yo ever figure this out? I just started getting the same error when upgrading a project to ArcEngine 10.3

0 Kudos