- var tableEnumerable = dt.AsEnumerable();
- var tableArray = tableEnumerable.ToArray();
- foreach (var data in tableArray)
- {
- lst.Add(data["Name"].ToString(),data["Age"] as string);
- }
Array to dictionary
I have array contains {[Name][Age],[Marks]}.I want to add the marks into dictionary .How can I?
Dinesh SanthalingamPosted Dec 27, 2016, 2:24 AM
@ Brijesh Rathor
Brijesh RathorPosted Dec 27, 2016, 2:21 AM
Brijesh RathorPosted Dec 27, 2016, 2:18 AM
An array is
string[], notList, so just do this:Now you can add your array as usual.