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.
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.