>I have a business class.  This class has properties for all the
>underlying database fields.
>There's a method called GetByID() that fetches 1 record based on the
>PK for that table.
>
>Great.  I can update the properties and call Save() which sends an
>update to the SQL table.
>
>But suppose I want to search for a range of records.
>So I have a method called GetBySurname() that can return multiple
>records.  This method returns a Recordset/array/SqlDataReader etc.
>
>But this doesn't really 'fit'.  The business object represents 1 record.
>
>What's a nice solution?


I have a separate "Query Manager" class that I use for this kind of thing.

In my framework, a business object usually handles not just one table 
(though it can), but a parent table and its children. I use these objects 
in combination with a data object for CRUD operations.

The Query Manager can execute complete SQL SELECT query statements that are 
passed to it, or can assemble a query from passed parameters (fields 
clause, FROM clause, WHERE clause, etc.). I use this to get lookup data, 
lookup lists, and for reports.

Ken Dibble
www.stic-cil.org



_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to