gertnerro

IFeatureLayer.Search return wrong number of records

Discussion created by gertnerro on Feb 15, 2011
Latest reply on Apr 26, 2011 by billm889
Hello, I tried to search just one feature from a featurelayer with this part of code:

....
IQueryFilter pQFilterPozTrafo = new QueryFilterClass();
pQFilterPozTrafo.WhereClause = "OBJECTID=109";
pQFilterPozTrafo.SubFields = "OBJECTID,SHAPE";

IFeatureCursor featureCursor = null;
comReleaser.ManageLifetime(featureCursor);
featureCursor = pFeatureLayerPozTrafo.Search(pQFilterPozTrafo, false);

int iCnt = 0;
IFeature oneFeature = featureCursor.NextFeature();
while (oneFeature != null)
       { 
.....


This code everytime returns all features from the featurelayer ... search method doesn't work with QueryFilter (I tried this - pQFilterPozTrafo.WhereClause = "xyz"; - with the same result = return all features).

Could anybody explain me why it happens???

Thanks

Roman

PS: ArcGIS 9.3.1, VS 2008, WinServer 2008

Outcomes