private void LoadTerminalId() { DataSet ds = new DataSet(); DataTable dt = new DataTable(); try { advisorBranchVo = (AdvisorBranchVo)Session["advisorBranchVo"]; if ((ds = advisorBranchBo.GetBranchTerminals(advisorBranchVo.BranchId)) != null) { dt.Columns.Add("Terminal Id"); DataRow dr; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = dt.NewRow(); dr["Terminal Id"] = ds.Tables[0].Rows[i]["AT_TerminalId"].ToString(); dt.Rows.Add(dr); } gvTerminalList.DataSource = dt; gvTerminalList.DataBind(); gvTerminalList.Visible = true; } else { gvTerminalList.DataSource = null; gvTerminalList.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "ViewBranchDetails.ascx.cs:LoadTerminalId()"); object[] objects = new object[2]; objects[0] = advisorBranchVo; objects[1] = ds; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }