List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change
i am getting this exception in my code.
my program is for offline exam where admin set the exam name,date&time and all
i want to show the questions related to chapters.


VulpesRank #55 · 29.2K reputationPosted Jan 9, 2015, 2:31 AM EST
If you try to run it, you get the following exception because you're attempting to modify the list in the foreach loop:
The output, as expected, is:
1
3
VulpesRank #55 · 29.2K reputationPosted Jan 9, 2015, 1:40 AM EST
If that's the case, then I'd use an 'ordinary' for statement instead of foreach.
Aman Gupta92 reputationPosted Jan 9, 2015, 2:15 AM EST
Can u plz send me the snippet code to understand me clearly
Thanks in advance :)