I created an OOP application.
The main Class is Project
within the project class it has 4 id fields that link to 4 lookup tables.
After creating project classes, my app puts them in a ProjectCollection and then binds this to a datagrid,
The problem I am having is how do I effeciently get the lookup values from the other tables in the database?
I was reading that it is bad practice to create a business object for each table in the database.
I originally set it up so when the app loads, it grabs all rows from the lookup tables and merges all of the datatables into one dataset (ds)
Now, when i am creating my project objects, i found it to be very ineffecient to loop through each of the 4 lookup tables for each project I put into the collection...
5 rows per lookup X 100(or more) Projects = 500 queries per load.
What is the best way to do this?
Please let me know if you need more information. Thank you.
The main Class is Project
within the project class it has 4 id fields that link to 4 lookup tables.
After creating project classes, my app puts them in a ProjectCollection and then binds this to a datagrid,
The problem I am having is how do I effeciently get the lookup values from the other tables in the database?
I was reading that it is bad practice to create a business object for each table in the database.
I originally set it up so when the app loads, it grabs all rows from the lookup tables and merges all of the datatables into one dataset (ds)
Now, when i am creating my project objects, i found it to be very ineffecient to loop through each of the 4 lookup tables for each project I put into the collection...
5 rows per lookup X 100(or more) Projects = 500 queries per load.
What is the best way to do this?
Please let me know if you need more information. Thank you.