public void DisplayDateRange(DateTime min, DateTime max) { UserBLL bll = new UserBLL(); TransactionBLL tll = new TransactionBLL(); List <ReportBO> lst = tll.Read_Report(); string head = String.Format("{0,-15} {1,-10} {2,-10} {3,-10} {4,-10}", "Transaction Type", "User ID", "Holders Name", "Amount", "Date"); WriteLine(head); for (int i = 0; i < lst.Count; i++) { DateTime temp; CultureInfo provider = CultureInfo.InvariantCulture; try { temp = DateTime.ParseExact(lst[i].Date, "d/MM/yyyy", provider); } catch (Exception ex) { temp = temp = DateTime.ParseExact(lst[i].Date, "dd/MM/yyyy", provider); } if (temp >= min.Date && temp <= max.Date) { WriteLine("{0,-15} {1,-10} {2,-10} {3,-10} {4,-10}", lst[i].Type, lst[i].User_Id, lst[i].Name, lst[i].Amount, lst[i].Date); } } }