public CustomerDemographicCollection FetchByQuery(Query qry) { CustomerDemographicCollection coll = new CustomerDemographicCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public CustomerDemographicCollection FetchAll() { CustomerDemographicCollection coll = new CustomerDemographicCollection(); Query qry = new Query(CustomerDemographic.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static Northwind.CustomerDemographicCollection GetCustomerDemographicCollection(string varCustomerID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [dbo].[CustomerDemographics] INNER JOIN [CustomerCustomerDemo] ON [CustomerDemographics].[CustomerTypeID] = [CustomerCustomerDemo].[CustomerTypeID] WHERE [CustomerCustomerDemo].[CustomerID] = @CustomerID", Customer.Schema.Provider.Name); cmd.AddParameter("@CustomerID", varCustomerID, DbType.String); IDataReader rdr = SubSonic.DataService.GetReader(cmd); CustomerDemographicCollection coll = new CustomerDemographicCollection(); coll.LoadAndCloseReader(rdr); return(coll); }