private void FillDropDown(DropDownList ddlAssignTo, string selectQuery, string table, string condition) { try { _rqstbl = new requestBL(); DataSet ds = _rqstbl.getDropDownValues(selectQuery, table, condition); ddlAssignTo.DataSource = ds.Tables[0]; ddlAssignTo.DataValueField = ds.Tables[0].Columns[0].ToString(); ddlAssignTo.DataTextField = ds.Tables[0].Columns[1].ToString(); ddlAssignTo.DataBind(); } catch (Exception ex) { throw; } }
private void FillCheckBox(string chk, string selectQuery, string table, string condition) { try { var chkname = (CheckBoxList)Form_Request.FindControl(chk); _rqstbl = new requestBL(); DataSet ds = _rqstbl.getDropDownValues(selectQuery, table, condition); chkname.DataSource = ds.Tables[0]; chkname.DataValueField = ds.Tables[0].Columns[0].ToString(); chkname.DataTextField = ds.Tables[0].Columns[1].ToString(); chkname.DataBind(); } catch (Exception ex) { throw; } }