Question regarding performance when binding multiple controls todatabase

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gnewsgroup

    Question regarding performance when binding multiple controls todatabase

    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.



  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Question regarding performance when binding multiple controls to d

    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)


    "gnewsgroup " wrote:
    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.
    >
    >
    >
    >

    Comment

    • gnewsgroup

      #3
      Re: Question regarding performance when binding multiple controls todatabase

      On Feb 11, 3:49 pm, bruce barker
      <brucebar...@di scussions.micro soft.comwrote:
      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!

      Comment

      Working...