public void FillCASGrid() { string CASList = ""; DataTable dt = new DataTable(); dt = VSWebBL.ExchangeBAL.Ins.GetCASStatus(); Session["CASStatusGrid"] = dt; //CASList.Text = "0"; CASList = "0"; if (dt != null && dt.Rows.Count > 0) { //CASList.Text = dt.Rows.Count.ToString(); CASList = dt.Rows.Count.ToString(); } CASGridView.DataSource = dt; CASGridView.DataBind(); //7/18/2014 NS added DataRow rolerow = srvroles.Rows.Add(); rolerow["Role"] = "CAS"; rolerow["RoleCount"] = Convert.ToInt32(CASList); }
public void FillCASGridfromSession() { DataTable DataServers = new DataTable(); try { if (Session["CASStatusGrid"] != null && Session["CASStatusGrid"] != "") { DataServers = Session["CASStatusGrid"] as DataTable; } if (DataServers.Rows.Count > 0) { DataServers.PrimaryKey = new DataColumn[] { DataServers.Columns["ID"] }; //CASList.Text = DataServers.Rows.Count.ToString(); } CASGridView.DataSource = DataServers; CASGridView.DataBind(); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }