Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to get all field names present in a feature class using queryfilter programmatically.

share|improve this question
    
What methods have you tried, how far did you get, and where specifically do you need help? –  whuber Aug 13 '12 at 14:05
1  
Thanks whuber.....i used query filter to get selected field names.....pQueryFilter.SubFields = "city_population,city_id"....but i want all the field names without passing them within quotes( " ")....any help ! –  Navish Aug 14 '12 at 3:53
    
Presumably this is for ArcGIS, right? (It's a good idea to put these details in the question itself.) –  whuber Aug 14 '12 at 11:55
    
Yes,featureclasses are stored in a pgdb.... –  Navish Aug 16 '12 at 3:39
    
If you want all fields, just specify "*" as the IQueryFilter.SubFields property. Otherwise, you can access the list of fields through IFeatureClass.Fields. –  Petr Krebs Aug 16 '12 at 20:31
show 1 more comment

1 Answer

ESRI has excellent documentation for everything. With a quick search you would most probably get what you want. Below snippet is slightly modified version copied from there

Public Sub DisplayDistinctFieldAliasNames(ByVal featureClass As IFeatureClass)
        Dim fields As IFields = featureClass.Fields
        Dim field As IField = Nothing

    For i As Integer = 0 To fields.FieldCount - 1
        field = fields.Field(i)
        Console.WriteLine(field.Name)
    Next i
End Sub
share|improve this answer
2  
"ESRI has excellent documentation for everything" -- not sure if serious. –  blah238 Aug 16 '12 at 18:33
    
@blah238 - at least for the desktop SDK, its god :-) –  vinayan Aug 17 '12 at 0:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.