- 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?
Brijesh RathorRank #7,391 · 242 reputationPosted Dec 26, 2016, 9:18 PM EST
An array is
string[], notList, so just do this:Now you can add your array as usual.
wordDictionary.Add("IN", new string[] {"Against","Like","Upon","Through","Of","With","Upon","On","Into","From","by","that","In","About","For","Along","Before","Beneath","At","Across","beside","After","Though","Among","Toward","If"});Brijesh RathorRank #7,391 · 242 reputationPosted Dec 26, 2016, 9:21 PM EST
Dinesh SanthalingamRank #2,085 · 690 reputationPosted Dec 26, 2016, 9:24 PM EST
@ Brijesh Rathor
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts