I can fill in my list dictator, but if error runs, then I would like to "foreach (string key in ld.keys)" (Invalid operation exception was unmanageable)
Error Extensions: The sample collection has been changed after creating an indicator in the list. C #
List list = new list site (); Foreign Currency (DataColumn DC in dTable.Columns) {MessageBox.Show (dTable.Rows [0] [DC] .Ostring ()); Ld.Add (dc.ColumnName, dTable.Rows [0] [DC]. Ostring ()); } Foreach (string ky in ld.Keys) (int.TryParse (ld [ky]. ToString (), quantityInt out)) LD [Kei] = "Integer"; And if (Double Tri-purse (LD [KE]. Ostring (), outside quantified double)) LD [Kei] = "double"; Else ld [ky] = "nvarchar"; Changes your second foreach loop list view by setting Ld [ky] = "whatever"; You can not do this with foreach loop, because internally it uses a calculator. It is illegal to calculate the collection when using a calculator.
Instead, use the loop.
Even better, do the whole thing in a single loop on DTib. Column, setting the value in the dictionary when adding each item.
ListDictionary ld = new ListDictionary (); Foreign Currency (DataColumn DC in dTable.Columns) {MessageBox.Show (dTable.Rows [0] [DC] .Ostring ()); string value; If (int.TryParse (dTable.Rows [0] [DC]. Ostring (), QuantityInt out) value = "Integer"; And if (double.Tri purse (DT.Lo [0] [DC]. Ostring (), out quantity W)) value = "double"; Other Values = "Nature"; Ld.Add (dc.ColumnName, value); }
Comments
Post a Comment