http://bbs.esrichina-bj.cn/ESRI/thread-19466-2-1.html
我 CreateFeature()一个feature后,然后给他复值怎么没反映,高手指点,不过createfeature我没有给他空间数据,
IFeatureLayer objFeatureLayer = (IFeatureLayer)axMap.Map.get_Layer(3);
objFeatureLayer.FeatureClass.GetFeature(1).set_Value(4, "3");
objFeatureLayer.FeatureClass.GetFeature(1).Store();
objFeatureLayer.FeatureClass.GetFeature(2).set_Value(6, 3);
objFeatureLayer.FeatureClass.Update(null, true);
我换了种方法,解决了
IFeatureLayer objFeatureLayer = (IFeatureLayer)axMap.Map.get_Layer(3);
IFeatureClass featureClass = objFeatureLayer.FeatureClass;
IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.WhereClause = "Groupid = 2";
//"U" = domain value for Utility // use FC.Update to populate IFeatureCursor
IFeatureCursor updateCursor = featureClass.Update(queryFilter, false);
int fieldIndex = featureClass.FindField("Groupid");
IFeature feature = updateCursor.NextFeature();
int m = 0;
while (feature != null)
{ m++;
feature.set_Value(fieldIndex, 1);
//"C" = domain value for Commercial
updateCursor.UpdateFeature(feature);
feature = updateCursor.NextFeature();
}