Multiple User Controls – Single Database Trip?

Discussion in 'ASP .Net' started by Paul Hale, Jun 13, 2008.

  1. Paul Hale

    Paul Hale Guest

    I have a web form that contains an Ajax TabContianer control with six tabs.
    Each tab contains a separate user control. Although each user control
    provides a unique UI all user controls require access to the same data. Im
    populating all tabs on one trip to the server so users can immediately switch
    between tabs without server round trips.

    At the moment each user control’s code behind hits the database for the same
    data meaning I have six separate database hits.

    My question is - Is it possible to hit the database once (perhaps from the
    aspx page that implements the user controls) and use the data throughout all
    the user controls?

    I know I could do away with all the user controls and embed the html
    directly under each tab but this would make my page very complex and I like
    the way I can segment html and code with separate user controls. I could also
    hit the database once and store the results in a session or cache but would
    prefer not to as the data will be unique for each user so this is probably
    not the most efficient way either.
     
    Paul Hale, Jun 13, 2008
    #1
    1. Advertising

  2. Paul Hale

    Munna Guest

    Re: Multiple User Controls – Single Database Trip?

    Hi

    "Is it possible to hit the database once?"

    Yes it is possiable...

    here is a link to help .. it about "Returning Multiple Resultsets
    with the DataReader"

    http://www.dotnetjohn.com/articles.aspx?articleid=23

    retrive all the data save in session

    Thanks

    Munna
     
    Munna, Jun 13, 2008
    #2
    1. Advertising

  3. Paul Hale

    Paul Hale Guest

    Thanks for responding but thats not really what im after. I know about batch
    select statements but my question is can I hit the database once and access
    this data via multiple user controls without storing the data in cache or
    sessions.

    I dont think this is possible but thought I would post to confirm.

    "Munna" wrote:

    > Hi
    >
    > "Is it possible to hit the database once?"
    >
    > Yes it is possiable...
    >
    > here is a link to help .. it about "Returning Multiple Resultsets
    > with the DataReader"
    >
    > http://www.dotnetjohn.com/articles.aspx?articleid=23
    >
    > retrive all the data save in session
    >
    > Thanks
    >
    > Munna
    >
    >
    >
     
    Paul Hale, Jun 13, 2008
    #3
  4. Paul Hale

    Paul Hale Guest

    Actually thinking about it I guess I could hit the db, lookup the controls I
    need to bind (that are contained within the seperate user controls) and bind
    that way.

    Think I have just answered my own question.

    "Paul Hale" wrote:

    > Thanks for responding but thats not really what im after. I know about batch
    > select statements but my question is can I hit the database once and access
    > this data via multiple user controls without storing the data in cache or
    > sessions.
    >
    > I dont think this is possible but thought I would post to confirm.
    >
    > "Munna" wrote:
    >
    > > Hi
    > >
    > > "Is it possible to hit the database once?"
    > >
    > > Yes it is possiable...
    > >
    > > here is a link to help .. it about "Returning Multiple Resultsets
    > > with the DataReader"
    > >
    > > http://www.dotnetjohn.com/articles.aspx?articleid=23
    > >
    > > retrive all the data save in session
    > >
    > > Thanks
    > >
    > > Munna
    > >
    > >
    > >
     
    Paul Hale, Jun 13, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGFycnk=?=

    Disable web page controls during postback round-trip

    =?Utf-8?B?TGFycnk=?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,215
    Adrian Parker
    Mar 9, 2006
  2. Sehboo
    Replies:
    2
    Views:
    452
    Sehboo
    Dec 12, 2006
  3. Sehboo
    Replies:
    1
    Views:
    363
    Mark Fitzpatrick
    Dec 13, 2006
  4. DC
    Replies:
    2
    Views:
    681
  5. Author #1
    Replies:
    2
    Views:
    1,212
    Cowboy \(Gregory A. Beamer\)
    Apr 25, 2009
Loading...

Share This Page