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);
        }
Esempio n. 3
0
        public static Northwind.ProductCollection GetProductCollection(int varCategoryID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [dbo].[Products] INNER JOIN [Product_Category_Map] ON [Products].[ProductID] = [Product_Category_Map].[ProductID] WHERE [Product_Category_Map].[CategoryID] = @CategoryID", Category.Schema.Provider.Name);
            cmd.AddParameter("@CategoryID", varCategoryID, DbType.Int32);
            IDataReader       rdr  = SubSonic.DataService.GetReader(cmd);
            ProductCollection coll = new ProductCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }