Question regarding performance when binding multiple controls todatabase

G

gnewsgroup

Suppose that I have 5 controls on a single aspx page that need to be
bound to a database. Each control will have different content.

(1) I can create a single stored procedure that returns 5 tables all
at once. Then in my code-behind, I only need to make 1 trip to the
database to get the data, parse the data and bind them to each of the
5 controls.

(2) I can also create 5 stored procedures, one for each control. And
then in my code-behind, I make 5 separate trips to the database to get
the data, once for one control only.

Should we do (1) whenever possible? I guess I am sorta sensitive/
allergic to database performance issue now.

Thanks.
 
B

bruce barker

or you can call all five procs in one batch.

one trip is better, you just get mulitiple result sets back, if the batch
calls mltiple (or the sp calls multiple).

-- bruce (sqlwork.com)
 
G

gnewsgroup

or you can call all five procs in one batch.

one trip is better, you just get mulitiple result sets back, if the batch
calls mltiple (or the sp calls multiple).

-- bruce (sqlwork.com)

OK, to call all five procs in one batch, we need to create another
stored procedure that calls these 5 stored procedures, right? Please
kindly let me know, I have always been wondering what people mean by
"one batch".

Thanks a lot!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top