looping thru entity fields

Posts   
 
    
Bposter
User
Posts: 4
Joined: 27-Sep-2004
# Posted on: 10-Dec-2004 19:44:22   

for(int i=0; i<fieldList.Count; i++) { entityFields.Fields["Field" + i] = (string)fieldList[i];

}

fieldList is an ArrayList of strings. Is there a piece of code or cast that I can use to accomplish this?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Dec-2004 20:35:48   

What do you want to accomplish? Setting the fields with the values in teh ArrayList?

for(int i=0; i<fieldList.Count; i++) { entityFields.Fields["Field" + i].CurrentValue = (string)fieldList[i]; }

or: for(int i=0; i<fieldList.Count; i++) { entityFields.Fields[i].CurrentValue = (string)fieldList[i]; }

or:

for(int i=0; i<fieldList.Count; i++) { entity.SetNewFieldValue(i, (string)fieldList[i]); }

Frans Bouma | Lead developer LLBLGen Pro
Bposter
User
Posts: 4
Joined: 27-Sep-2004
# Posted on: 10-Dec-2004 20:48:29   

The last. Thx.