3
Reply

data table to dictionary

Dinesh Santhalingam

Dinesh Santhalingam

Dec 23 2016 5:25 AM
228
I have a data table .i want to load my entire data table to my dictionary without reading each row every time.suggest me some ideas?
 


  1. data table dt=new data table();
//I have some data in my table
  1. Dictionary<string, object> lst = new Dictionary<string, object>();  
  2.   
  3. try  
  4. {  
  5. lst.Add(row["Time"].ToString(), row["Inuse"] as string);
  6. }  
  7. catch (Exception ex)  
  8. {  
  9.     throw ex;  
  10. }  
  11.   
  12. return lst;  

 I tried this.But i want to load data table without using foreach loop .

Upload Source Code  Select only zip and rar file.
Answers (3)