When I am going to modify hashtable data it is giving me the exception."Collection was modified; enumeration operation may not execute"
Here is the code..
foreach (DictionaryEntry Item in hashtable)
{
switch(Item.key.ToString())
{
case "Color":
{
hashtable["Color"]="ffffff";
break;
}
case "Width":
{
hashtable["Width"]="40";
break;
}
}
}
My qustion is ,
Is there any other way to iterate through hashtable by using ' foreach ' so that I can modify iterating hashtable?