private void FillAppendixe3() { cboAppendix3.Items.Clear(); string[] orderBy = new string[] { "Appendix3Code" }; ProductAppendix3Collection oA3List = ProductAppendix3.LoadCollection(orderBy, true); oA3List.Add(new ProductAppendix3()); cboAppendix3.DataSource = oA3List; cboAppendix3.DisplayMember = "Appendix3Code"; cboAppendix3.ValueMember = "Appendix3Id"; cboAppendix3.SelectedIndex = cboAppendix3.Items.Count - 1; }
/// <summary> /// Loads a collection of ProductAppendix3 objects from the database. /// </summary> /// <returns>A collection containing all of the ProductAppendix3 objects in the database.</returns> public static ProductAppendix3Collection LoadCollection(string spName, SqlParameter[] parms) { ProductAppendix3Collection result = new ProductAppendix3Collection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { ProductAppendix3 tmp = new ProductAppendix3(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }