How can i use listDictionary?
- by Phsika
i can fill my listdictinary but, if running error returns to me in " foreach (string ky in ld.Keys)"(invalid operation Exception was unhandled)
Error Detail : After creating a pointer to the list of sample collection has been changed. C#
ListDictionary ld = new ListDictionary();
foreach (DataColumn dc in dTable.Columns)
{
MessageBox.Show(dTable.Rows[0][dc].ToString());
ld.Add(dc.ColumnName, dTable.Rows[0][dc].ToString());
}
foreach (string ky in ld.Keys)
if (int.TryParse(ld[ky].ToString(), out QuantityInt))
ld[ky] = "integer";
else if(double.TryParse(ld[ky].ToString(), out QuantityDouble))
ld[ky]="double";
else
ld[ky]="nvarchar";