protected void searchButton_Click(object sender, EventArgs e) { CultureInfo myCultureInfo = new CultureInfo("de-DE"); string fromDate = fromDateTextBox.Text; string toDate = toDateTextBox.Text; if (fromDate == "" || toDate == "") { messageLabel.Text = "Please Select Date"; } else { DateTime dt1 = DateTime.Parse(fromDate); DateTime dt2 = DateTime.Parse(toDate); if (dt1.Date > dt2.Date) { messageLabel.Text = "Invalid date range!"; itemGridView.DataSource = null; itemGridView.DataBind(); } else { List <GetStockInfoView> getStockInfoViews = stockOutManager.GetDataBtnDate(fromDate, toDate); if (getStockInfoViews.Count == 0) { messageLabel.Text = "No data found!"; } else { messageLabel.Text = "Data found!"; itemGridView.DataSource = stockOutManager.GetDataBtnDate(fromDate, toDate); itemGridView.DataBind(); } } } }