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?
- data table dt=new data table();
//I have some data in my table
- Dictionary<string, object> lst = new Dictionary<string, object>();
-
- try
- {
- lst.Add(row["Time"].ToString(), row["Inuse"] as string);
- }
- catch (Exception ex)
- {
- throw ex;
- }
-
- return lst;
I tried this.But i want to load data table without using foreach loop .