[C#]
public void IQueryFilter__(IFeatureClass featureClass)
{
IQueryFilter queryFilter = new QueryFilterClass();
//Setting the SubFields and WhereClause:
//if you are updating the geometry you must include the shapefield in the subfields.
queryFilter.SubFields = "STATE_NAME,POPULATION";
queryFilter.WhereClause = "STATE_NAME = 'California'";
//Using a query filter to search a feature class:
IFeatureCursor featureCursor = featureClass.Search(queryFilter, false);
}
WhereClaus用法
正确用法
//queryFilter.WhereClause = "ROALS_= 8690";
//queryFilter.WhereClause = "ROALS_= " + ID;
错误用法
queryFilter.WhereClause = "ROALS_= ID";