Good Day Experts!
I am in need of some design assistance with my little project. This is kind of like a the traditional Hdr/Dtl SQL table setup but a slightly different. Instead of let's say an invoice number Hdr record with part number Dtl records...I have Hdr table records that contain those part Numbers. However, I still do need to get to the Dtl table to get info for each part number.
I am building a CSV file. To process and build the CSV file for one 650 record invoice it is taking about 12minutes. I suspect it may be the call to the db each time through the loop to get the detail information. The Dtl table contains potentially multiple records for a part number. So, I was trying to not do a join in my initial loop query just to keep the processing "cleaner" and "easier" but I am questioning that.
Would you think it would be better loop through the Hdr record and grab all the Dtl table records putting them in a DataTable instead of making a call to the Database 650 times?
Please ask more questions as I probably did not explain completey.