Question regarding performance when binding multiple controls todatabase

  • Thread starter Thread starter gnewsgroup
  • Start date Start date
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.
 
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)
 
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!
 
Back
Top