I am facing the issue while I am trying to get all the features back in 'Attribute Table'. What I am doing is.
I tried with below code :
In both the case it's giving error.
///////1st////////// IFeatureClass pFc = ilayer.FeatureClass; IFeatureCursor pFCursor; IFeature pF; queryFilterlast.WhereClause = "SHAPE.LEN IS NOT NULL"; pFCursor = pFc.Search(queryFilterlast, false); pF = pFCursor.NextFeature(); while (pF != null) { pF = pFCursor.NextFeature(); } /////////2nd////////////// //initialize queryfilter queryFilterlast.SubFields = "*"; queryFilterlast.WhereClause = "SHAPE.LEN IS NOT NULL"; //Using a query filter to search a feature class: featureselectionlast.SelectFeatures(queryFilterlast, esriSelectionResultEnum.esriSelectionResultNew, false); //output features assign into featureset featuresetlast = featureselectionlast.SelectionSet; if (featuresetlast.Count != 0) { featuresetlast.Search(null, false, out icursor); //featureCursor = icursor as IFeatureCursor; IFeatureCursor featureCursorL = icursor as IFeatureCursor; //Get the output features IFeature feature = featureCursorL.NextFeature(); //Loop through output features while (feature != null) { feature = featureCursorL.NextFeature(); } //Release the cursor System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursorL); featureCursorL = null; }
أكثر...
- Selected the layer from Map
- Performs my Edits on few features (changing filed values)
- While I again want to get all my features back I am getting error.
I tried with below code :
In both the case it's giving error.
///////1st////////// IFeatureClass pFc = ilayer.FeatureClass; IFeatureCursor pFCursor; IFeature pF; queryFilterlast.WhereClause = "SHAPE.LEN IS NOT NULL"; pFCursor = pFc.Search(queryFilterlast, false); pF = pFCursor.NextFeature(); while (pF != null) { pF = pFCursor.NextFeature(); } /////////2nd////////////// //initialize queryfilter queryFilterlast.SubFields = "*"; queryFilterlast.WhereClause = "SHAPE.LEN IS NOT NULL"; //Using a query filter to search a feature class: featureselectionlast.SelectFeatures(queryFilterlast, esriSelectionResultEnum.esriSelectionResultNew, false); //output features assign into featureset featuresetlast = featureselectionlast.SelectionSet; if (featuresetlast.Count != 0) { featuresetlast.Search(null, false, out icursor); //featureCursor = icursor as IFeatureCursor; IFeatureCursor featureCursorL = icursor as IFeatureCursor; //Get the output features IFeature feature = featureCursorL.NextFeature(); //Loop through output features while (feature != null) { feature = featureCursorL.NextFeature(); } //Release the cursor System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursorL); featureCursorL = null; }
أكثر...