protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dtMax = gen.GetDataTable("SPSelectDCNMForMaxRecord"); if (dtMax.Rows.Count > 0) { string strMaxNo = (Convert.ToInt32(dtMax.Rows[0]["maxRecord"].ToString()) + 1).ToString(); lblDCNO.Text = strMaxNo; } else { lblDCNO.Text = "00000000001"; } txtDate.Text =DateTime.Now.ToString(); fillCustomerName(); BindGrid(); }
DataTable dtMax = gen.GetDataTable("SPSelectDCNMForMaxRecord"); if (dtMax != null && dtMax.Rows.Count > 0)
null
// checks the DataTable isn't null, the maxRecord valus isn't null and DataTable has rows if (dtMax != null && dtMax.Rows.Count > 0 && dtMax.Rows[0]["maxRecord"] != null)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)