Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Collection was modified; enumeration operation might not execute.?
how can i solved?
Posted
Updated 27-Sep-10 21:34pm
v2
Comments
Hiren solanki 28-Sep-10 3:38am    
the word 'errore' replaced by 'error' in the subject line.

I did this[^], got few of these and more:
Discussion 1[^]
Discussion 2[^]
Discussion 3[^]
 
Share this answer
 
Comments
Ashika s 28-Sep-10 23:44pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
Collection was modified; enumeration operation might not execute

This error probably occurs when you are trying to loop through any collection and at the same time you are modifying that collection.

So my advice would be to store modified value to temp. collection first and after accomplishing all the modification assign that collection to original collection.

Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
Ashika s 28-Sep-10 23:44pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900