I am trying to add a list column as well as assign a value to the list column which is newly created in the document libraries available in the site. After the value is assigned, when the second document library is about to iterate, I am getting an error
as "Collection was modified; enumeration operation may not execute".
Below is the code i have used:
SPListCollection mylists = currentweb.GetListsOfType(SPBaseType.DocumentLibrary);
foreach (SPList list in mylists)
AddField("CustomColumn", SPFieldType.Text, list.Fields);
fieldCol.View.DefaultView = true;
int mouas = 5;
folder.Item["CustomColumn"] = mouas;
How to rectify this?
View Complete Post