public clsDropDown DataLoader(IDataReader reader) { clsDropDown clsDdl = new clsDropDown(); clsDdl.ValueFieldText = reader.GetValue(0).ToString(); clsDdl.DisplayFieldText = reader.GetValue(1).ToString(); return(clsDdl); }
public List <clsDropDown> getDropDownList(string sStoreProcedure, System.Data.Common.DbParameter[] parameters) { SqlDataAccess objConnection = new SqlDataAccess(clsConstant.DBCONSTRING); clsDropDown clsDdl; if (objConnection.Connection.State == ConnectionState.Closed) { objConnection.Connection.Open(); } //List<clsDropDown> lst=new List<clsDropDown>(); List <clsDropDown> lst; lst = objConnection.ExecuteObjectQuery <clsDropDown>(sStoreProcedure, CommandType.StoredProcedure, DataLoader, parameters); clsDdl = new clsDropDown(); clsDdl.ValueFieldText = "0"; clsDdl.DisplayFieldText = "----------SELECT----------"; lst.Insert(0, clsDdl); //lst.Add(clsDdl); return(lst); }