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.

Is it possible to assign a list or array to IRowBuffer Row?

I have something like the following: I have a fields (list) with values and i have to fill a Row with that values.

public void fillRow(IRowBuffer Row)
 {
  for (int i=0;i < fields.length;i++)
    {
      Row.set_Value(i, fields[i].toString()
    }
 }

Is there no way where i can just assign the fields to Row, without looping. What if my fields has like 500 elements and i have to loop 100x500? I know that Row has 2 requiredFields (ID, SHAPE)

Edit: Nobody working with ArcObjects?

share|improve this question
    
If there was a method that accepted the array wouldn't ArcObjects just be running the same loop under the covers anyway? If I was you I wouldn't worry about how the values are set but about the 1,000 other things that can go wrong in an ArcObjects tool –  tomfumb Aug 30 '12 at 19:05
    
Do you mean you want to see how to use a list of field indices? That way you can avoid getting an exception on row.set_value(0,"") since the OID is usually in that position, and is not editable. (IField.Editable is false). –  Kirk Kuykendall Aug 30 '12 at 19:23
    
@KirkKuykendall Hmm, i wanted something like this Row = fields[i]. the i-element would be an array or list. But i have to set every column and row individually? –  Gero Aug 30 '12 at 20:48
    
If the field is a Blob, and the list you are assigning to it is serializable, I suppose you could do it via IMemoryBlobStream. However, you still need to call set_Value for each field you want to populate AFAIK. –  Kirk Kuykendall Aug 30 '12 at 21:18
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.