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