public List <Dictionary <string, object> > getInProgressBatchIDs() { obj = new DSL(); DataTable dt; dt = obj.getScheduledBatches(); JavaScriptSerializer serializer = new JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); Dictionary <string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } return(rows); }