protected void btnGo_OnClick(object sender, EventArgs e) { try { LogBl objBL = new LogBl(); ApplicationResult objResult = new ApplicationResult(); DateTime dtFromDateTime = DateTime.ParseExact(txtFromDate.Text + " " + txtFromTime.Text, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture); DateTime dtToDateTime = DateTime.ParseExact(txtToDate.Text + " " + txtToTime.Text, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture); objResult = objBL.DryingProductionLog(dtFromDateTime, dtToDateTime); if (objResult.ResultDt.Rows.Count > 1) { divNo.Visible = false; gvDryingProductionLog.Visible = true; gvDryingProductionLog.DataSource = objResult.ResultDt; gvDryingProductionLog.DataBind(); } else { divNo.Visible = true; gvDryingProductionLog.Visible = false; } } catch (Exception ex) { log.Error("Error", ex); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>"); } }