/// <summary> /// SET DATA TO Dropdown ddlCurrentOperation /// </summary> private void BindProprietor() { objMasterBLL = new MasterBLL(); objProprietorList = objMasterBLL.LoadProprietorData(); if (objProprietorList.Count > 0) { ddlCurrentOperation.DataSource = objProprietorList; ddlCurrentOperation.DataTextField = "ProprietorName"; ddlCurrentOperation.DataValueField = "ProprietorID"; ddlCurrentOperation.DataBind(); } }
/// <summary> /// To Load Proprietes Data /// </summary> /// <returns></returns> public ProprietorList LoadProprieterData() { cnn = new OracleConnection(AppConfiguration.ConnectionString); string proc = "USP_MST_GET_PROPRIETORGROUP"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); ProprietorBO obProprietor = null; ProprietorList Proprietor = new ProprietorList(); while (dr.Read()) { obProprietor = new ProprietorBO(); obProprietor.ProprietorID = dr.GetInt32(dr.GetOrdinal("ID")); obProprietor.ProprietorName = dr.GetString(dr.GetOrdinal("Name")); Proprietor.Add(obProprietor); } dr.Close(); return(Proprietor); }