IQueryFilter pQF = new QueryFilterClass();
IQueryFilterDefinition queryFilterDef = (IQueryFilterDefinition)pQF;
queryFilterDef.PostfixClause = "ORDER BY " + (axMapControl1.get_Layer(0) as IFeatureLayer).DisplayField;
IFeatureCursor pFeatureCursor = pFC.Search(pQF, true);//pFC,featureclass
还需要注意一点,此属性不适用与FileGDB:Please note, file geodatabases do not support the PostFixClause property, and any specifications within the PostFixClause will be ignored。
结果curcor里面的feature就已经按照displayfield排好序了。另外,如果要对已有表进行排序的话可以使用ITableSort接口。
没有评论:
发表评论