Hi,
I was wondering what would lead to the best performance for the next situation. I have a product table and a product variants table. So T-shirt with sizes X, XL, M, S. I would like to show all these products including their sizes in a grid so visitors can see what products and sizes are in stock. I am wondering what is the best way of collecting this data from the database? I assume I have 100 products and every product 4 variants. So 400 dataitems in total.
I have a productcontroller() and a productvariantscontroller()
1. Using DAL of DNN. So I call productcontroller() to get products and then on the databind I do a get to collect with the productvariantscontroller() for each product the variants. So I do: 1 fill with 100 returning products and 400 calls to fill these 100 returning products.: 1 + 400 = 401 database calls.
2. I am using dataset: I call 2 times the database: 1 to fill products and 1 to fill productvariants: so 2 database calls.
3. I can also create a class with has product + variants information in it and with a table join on the database I collect this information. However, the product information id redundant.. but that would be option 3.
In my opinion 2 is fastest, or does it not matter? Or is there a way to bind relationships with the DAL of DNN?
Any help from some application architects would be great!
J.