public TerritoryCollection FetchByQuery(Query qry) { TerritoryCollection coll = new TerritoryCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public TerritoryCollection FetchAll() { TerritoryCollection coll = new TerritoryCollection(); Query qry = new Query(Territory.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static Northwind.TerritoryCollection GetTerritoryCollection(int varEmployeeID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [dbo].[Territories] INNER JOIN [EmployeeTerritories] ON [Territories].[TerritoryID] = [EmployeeTerritories].[TerritoryID] WHERE [EmployeeTerritories].[EmployeeID] = @EmployeeID", Employee.Schema.Provider.Name); cmd.AddParameter("@EmployeeID", varEmployeeID, DbType.Int32); IDataReader rdr = SubSonic.DataService.GetReader(cmd); TerritoryCollection coll = new TerritoryCollection(); coll.LoadAndCloseReader(rdr); return(coll); }