public void OfficeBind() { bl1.District_id = DDL_District.SelectedItem.Value; bl1.Department_id = DDL_Department.SelectedItem.Value; bl1.Role = h_roll_id.Value; dt = dl1.Get_Office(bl1); DDL_Office.DataSource = dt.table; DDL_Office.DataTextField = "OfficeName"; DDL_Office.DataValueField = "NewOfficeCode"; DDL_Office.DataBind(); DDL_Office.Items.Insert(0, new ListItem("--Select Office--", "0")); }
public void OfficeBind() { dl_RTI_Request objDL = new dl_RTI_Request(); string dept = DDL_BaseDepartment.SelectedItem.Value; string district = RTI_DDL_District.SelectedItem.Value; string officeCategory = DDL_OfficeCategory.SelectedItem.Value; string officeLevel = DDL_OfficeLevel.SelectedItem.Value; string strquery = "SELECT NewOfficeCode, OfficeName FROM office WHERE " + " office.BaseDeptCode='" + dept + "' AND office.DistrictCodeNew='" + district + "'" + " AND office.OfficeCategory='" + officeCategory + "' AND office.OfficeLevel='" + officeLevel + "' order by OfficeName "; ReturnClass.ReturnDataTable dt = objDL.Get_RTI_DDL_Data(strquery); DDL_Office.DataSource = dt.table; DDL_Office.DataTextField = "OfficeName"; DDL_Office.DataValueField = "NewOfficeCode"; DDL_Office.DataBind(); DDL_Office.Items.Insert(0, new ListItem("--Select Office--", "0")); }