I have :
- FeatureClass (Structure)
- column (Type)
- column (OID)
I am trying to get the (Type) for specific OID.
I tried to use this code but it dose not work.
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
IFeatureClass testFeatureClass = featureWorkspace.OpenFeatureClass("Structure");
IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.SubFields = "Type";
queryFilter.WhereClause = "OBJECTID = " + feature.OID;
IFeatureCursor fCursor = testFeatureClass.Search(queryFilter, true);
I don't know what is the wrong, any help would be appreciated.
Best Answer
You can get field value by doing the following. 1. Select your feature. 2. Cursor through feature to see if selection set is > 1 (below is code example for step 2).