Tuesday, June 3, 2008

IQueryFilter Example with Description

IQueryFilter filters data based on an attribute query. A string defining a where clause is required. An optional list of columns may be included to specify the column values to be retrieved. If no columns are specified, all values will be returned.
When To Use
When you need to filter data based on attribute values or the relationships between attributes.
Let's do it by one example
Dim pQueryFilter As IQueryFilter
Set pQueryFilter = New QueryFilter
Setting the SubFields and WhereClause: pQueryFilter.SubFields = "STATE_NAME,POPULATION"
pQueryFilter.WhereClause = "STATE_NAME = 'California'"
Using a query filter to search a feature class:Dim pFeatureCursor As IFeatureCursor
Set pFeatureCursor = pFeatureClass.Search(pQueryFilter, False)

2 comments:

Daniele said...

does not work
I need some reference in particular?

Manoj Singh said...

Do you want me to write a complete program which explain this or something else, Please let me know if you want any help regarding arcobject at this id
manojsinghrana@gmail.com