public DataTable BindDispatchDetails() { DataTable resultDT = new DataTable(); dispatchDetails = performLookup.GetLastWeeksDispatchDetail(); if (dispatchDetails != null) { #region Set Columns resultDT.Columns.Add("Dispatch Day", typeof(DateTime)); resultDT.Columns.Add("Day of Week"); resultDT.Columns.Add("Dispatch By"); resultDT.Columns.Add("Start Time"); resultDT.Columns.Add("Orders", typeof(int)); resultDT.Columns.Add("Quantity", typeof(int)); #endregion foreach (var detail in dispatchDetails) { resultDT.Rows.Add(detail.DESPATCH_DAY.Replace("_", " "), detail.DAYOFWEEK, detail.DESPATCH_BY, detail.START_TIME, detail.ORDS, detail.QTY); } } else { } return(resultDT); }