September 29, 2005 at 3:54 pm
Hi, this is possibly better suited to a dotnet forum but while I was in the area....
I'm creating some aspx pages that will feature data from a sql datasource (SQL 2000)
Each page will potentially contain unrelated data from 2 or more tables. This data will appear in different places on the same page (e.g. headlines, FAQs, links) all pertaining to that page (topic).
My question is... what is the best way to handle this (connection and resource wise)?
Leaving the connection object open, some fancy new .net control whcih can combine all the datasets and allow you to pick from the one place when "drawing" the page?
Hope this is making sense! Anyone know of an URL/article that deals with this particular thing?
September 30, 2005 at 2:33 am
I think your best bet would be to execute stored procedures returning parameters and simply assign the output parameters to the appropriate controls.
eg Open the database, execute the stored procedures, close the database and assign the parameter values to the controls.
The mantra is: Open late, Close early
This helps .Net connection pooling make the most of resources.
I use this method (amongst others) on our corporate web site
Hope this helps
Quis custodiet ipsos custodes.
September 30, 2005 at 6:42 am
If you want to use data bound controls on your page, you will need to use a dataset and one or more data tables within the dataset for your data sources. You can create multiple unrelated data tables in a single dataset or you can use different datasets. Even if you use different datasets, they can all be populated from a single connection and then the connection can be closed.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply