public ProductCollection FetchByQuery(Query qry) { ProductCollection coll = new ProductCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public ProductCollection FetchAll() { ProductCollection coll = new ProductCollection(); Query qry = new Query(Product.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static NorthwindAccess.ProductCollection GetProductCollection(int varCategoryID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [Products] INNER JOIN [Product_Category_Map] ON [Products].[ProductID] = [Product_Category_Map].[ProductID] WHERE [Product_Category_Map].[CategoryID] = PARM__CategoryID", Category.Schema.Provider.Name); cmd.AddParameter("PARM__CategoryID", varCategoryID, DbType.Int32); IDataReader rdr = SubSonic.DataService.GetReader(cmd); ProductCollection coll = new ProductCollection(); coll.LoadAndCloseReader(rdr); return(coll); }