예제 #1
0
        public CustomerCollection FetchByQuery(Query qry)
        {
            CustomerCollection coll = new CustomerCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #2
0
        public CustomerCollection FetchAll()
        {
            CustomerCollection coll = new CustomerCollection();
            Query qry = new Query(Customer.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #3
0
        public static Northwind.CustomerCollection GetCustomerCollection(string varCustomerTypeID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [dbo].[Customers] INNER JOIN [CustomerCustomerDemo] ON [Customers].[CustomerID] = [CustomerCustomerDemo].[CustomerID] WHERE [CustomerCustomerDemo].[CustomerTypeID] = @CustomerTypeID", CustomerDemographic.Schema.Provider.Name);
            cmd.AddParameter("@CustomerTypeID", varCustomerTypeID, DbType.String);
            IDataReader        rdr  = SubSonic.DataService.GetReader(cmd);
            CustomerCollection coll = new CustomerCollection();

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