private void DeleteRemarks(string sql) { ProductRemarksCollection oRemarksList = ProductRemarks.LoadCollection(sql); foreach (ProductRemarks oRemarks in oRemarksList) { oRemarks.Delete(); } }
/// <summary> /// Loads a collection of ProductRemarks objects from the database. /// </summary> /// <returns>A collection containing all of the ProductRemarks objects in the database.</returns> public static ProductRemarksCollection LoadCollection(string spName, SqlParameter[] parms) { ProductRemarksCollection result = new ProductRemarksCollection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { ProductRemarks tmp = new ProductRemarks(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }