|
-
Aug 18th, 2003, 04:32 AM
#1
Thread Starter
Member
Problem removing object from collection (RESOLVED)
I have a SortedList called m_FieldMappings.
All objects in it that are marked 'Delete', i want to remove from the SortedList.
foreach (FieldMapping map in m_FieldMappings.GetValueList())
{
if (map.DBState == enDBAction.Delete) m_FieldMappings.Remove(map.key);
}
The problem seems to be that since I am doing a foreach, the collection should not change otherwise you get an enumeration error.
I'm looking for another way of doing this.
Last edited by Genie; Aug 18th, 2003 at 06:57 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|