3
Reply

Array to dictionary

Dinesh Santhalingam

Dinesh Santhalingam

7 years ago
238
I have  array contains {[Name][Age],[Marks]}.I want to add the marks into dictionary .How can I?
  1. var tableEnumerable = dt.AsEnumerable();  
  2.  var tableArray = tableEnumerable.ToArray();  
  3.                         foreach (var data in tableArray)  
  4.                         {  
  5.                           lst.Add(data["Name"].ToString(),data["Age"] as string);  
  6.                             
  7.                         }  

Answers (3)