I am trying to implement a simple construct where I first clear the NameValueCollection and the write new values to it. However at the moment I can't because it is read only. Is there a way to make it not read only or a walk around? My Code:
NameValueCollection DataDictionary = ConfigurationManager.GetSection("dataDictionary") as NameValueCollection;
DataDictionary.Clear();
for (int i = 0; i < tableLayoutPanel2.RowCount; i++)
{
var T = tableLayoutPanel2.GetControlFromPosition(1, i);
var T2 = tableLayoutPanel2.GetControlFromPosition(3, i);
string key = T.Text;
string value = T2.Text;
DataDictionary.Add(key, value);
}
Copy it in a new NameValueCollection:
var writableCollection = new NameValueCollection(DataDictionary);
writableCollection.Add(...);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With