Modify the Value like this:Dictionary[key] = newvalue;
in common sense ,we modify the value in circle hitting our head
foreach(KeyValuePair<Tkey,Tvalue> keys in Dictionary<Tkey,Tvalue>)
{
//modify the value you wanted;
}
doing this ,we have got an error saying the directionay had changed
so we do it like this;
first collect its keys to get a list
List<Tkey > list = new List<Tkey >()
foreach(var key in Dictionary<Tkey,Tvalue>)
{
list.add(key);
}
then ,we can modify the values by its keys as stated earlier;
foreach(var key in list)
{
Directionay[key] = newValue;
}
ok,now ,we can finish the work without errors
of course ,we can use the dataset to implement our minds,here ,i just want to show one ways ;