public CustomerCollection FetchByQuery(Query qry) { CustomerCollection coll = new CustomerCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public CustomerCollection FetchAll() { CustomerCollection coll = new CustomerCollection(); Query qry = new Query(Customer.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
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); }