Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am migrating code for an ArcGIS extension from 9.3 to 10.1. The code is throwing an exception in one place.

My duty is just to migrate it to 10.1, so I really don't like to do any modification more than few lines of code.

The code is searching for a feature that was deleted by the user on a child version, but 1 - it is not posted yet to the default version 2 - The edit session is still open and not saved.

so before the save it is trying to validate some business rules.

IFeatureWorkspace childWorkspace = (IFeatureWorkspace)childVersion;
IFeatureClass childOperationalUnit = childWorkspace.OpenFeatureClass("OperationUnit");
IFeature childFeature = childOperationalUnit.GetFeature(Id_Of_Deleted_Feature);
if (childFeature != null)
{
 string operationName = childFeature.get_value(Index_Of_Name_Column); 

if (operationName == "somevalue")
......
}

So, the code is trying to access the attributes of a deleted feature. The code was working on 9.3

But on 10.1 is not working and giving me the error:

System.Runtime.InteropServices.COMException (0x8004100C): The feature is deleted The error happening on the line where we try to get the attributes of the feature with get_value

so, 10.1 can find the feature but cannot access its attributes.

is there any easy way to keep the code working without really modifying lots of code?

share|improve this question
1  
Did you try IDataChangesEx? –  Kirk Kuykendall Apr 3 '13 at 23:11

1 Answer 1

up vote 1 down vote accepted

Thanks Kirk That worked. IDataChangesEx has a method called ExtractEx , which return a cursor with the modified rows, and you can actually access the attributes for a deleted row.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.