1

I have a points shapefile with City, State, Zip columns. I want to merge the column data together into a new column containing: City-State-Zip (with the hyphen).

Can I merge column data like this using a IFeatureClass? If not what should I try?

2
  • Is a Calculate Field or IFeatureCursor operation not within the scope of this task?
    – Nathanus
    Dec 6 '11 at 19:48
  • Let me type you up an answer...
    – Nathanus
    Dec 6 '11 at 21:51
2

Depending on whether you want to update all rows or just the selected row, you could make use of IFeatureClass's Search or Update methods to obtain an IFeatureCursor that you could then use to create your concatenated attribute value and then plop it into the IFeature using IFeature.Value if I'm not mistaken.

Personally, however, I always prefer to cast an IFeatureClass to an ITable. I just find myself more comfortable working with them. :)

1
  • 2
    +1 Don't forget to call ReleaseComObject on the cursor when done with it. Dec 6 '11 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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