where to put load of static data?

Discussion in 'ASP .Net' started by =?Utf-8?B?Q2hyaXM=?=, Oct 3, 2005.

  1. Hi,

    I am wondering where in my ASP.NET application to load a dropdown list box
    that
    basically only changes once a year.

    I load a drop down list box with about 40 locations. If it never changes
    should I put it in the page load event of the page?

    Could I not put the loading of the dataset into the applicaton start event? or
    cache it on server in some way? Each time a new user visits the page and
    before it has been added to view state, it accesses the database. I'd like to
    minimized access to the database for something that never changes.

    thanks

    Chris
    =?Utf-8?B?Q2hyaXM=?=, Oct 3, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Q2hyaXM=?=

    Mr Newbie Guest

    One way is to create an XML file with your locations in and store it in the
    local directory of your project. You can use the page_laod event to load
    this into a dataset and then bind the DropDown to the dataset, this way when
    you want to change the locations, you need only change the XML file.




    "Chris" <> wrote in message
    news:...
    > Hi,
    >
    > I am wondering where in my ASP.NET application to load a dropdown list box
    > that
    > basically only changes once a year.
    >
    > I load a drop down list box with about 40 locations. If it never changes
    > should I put it in the page load event of the page?
    >
    > Could I not put the loading of the dataset into the applicaton start
    > event? or
    > cache it on server in some way? Each time a new user visits the page and
    > before it has been added to view state, it accesses the database. I'd like
    > to
    > minimized access to the database for something that never changes.
    >
    > thanks
    >
    > Chris
    Mr Newbie, Oct 3, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?Q2hyaXM=?=

    rviray Guest

    I would do what Mr Newbie said and put it in an XML file...but to g
    further, I would then load it into Server Cache (for a little bi
    faster performance) with a Dependency on that XML file...so that whe
    your list changes (next year...possibly), the Cache will update base
    on the change

    --
    rvira
    -----------------------------------------------------------------------
    rviray's Profile: http://www.msusenet.com/member.php?userid=421
    View this thread: http://www.msusenet.com/t-187109512
    rviray, Oct 3, 2005
    #3
  4. =?Utf-8?B?Q2hyaXM=?=

    Mr Newbie Guest

    Good point regarding dependency!

    Regards Mr Newbie . . . .




    "rviray" <> wrote in message
    news:...
    >
    > I would do what Mr Newbie said and put it in an XML file...but to go
    > further, I would then load it into Server Cache (for a little bit
    > faster performance) with a Dependency on that XML file...so that when
    > your list changes (next year...possibly), the Cache will update based
    > on the change.
    >
    >
    > --
    > rviray
    > ------------------------------------------------------------------------
    > rviray's Profile: http://www.msusenet.com/member.php?userid=4211
    > View this thread: http://www.msusenet.com/t-1871095120
    >
    Mr Newbie, Oct 3, 2005
    #4
  5. thanks for responses.

    The locations are coming from data table that is used extensively by other
    websites and applications.

    I also created a data relations (child parent) using 2 fields in the
    locations table.
    I would have to manually create the XML with the Relations created manually.

    Later I can write a tiny application that exports the list of locations
    using the datarelation to an XML file.

    On further thought I think I will stay with the database load for now and use
    server caching to speed things up a bit.

    thanks for replies.

    Chris

    "Chris" wrote:

    > Hi,
    >
    > I am wondering where in my ASP.NET application to load a dropdown list box
    > that
    > basically only changes once a year.
    >
    > I load a drop down list box with about 40 locations. If it never changes
    > should I put it in the page load event of the page?
    >
    > Could I not put the loading of the dataset into the applicaton start event? or
    > cache it on server in some way? Each time a new user visits the page and
    > before it has been added to view state, it accesses the database. I'd like to
    > minimized access to the database for something that never changes.
    >
    > thanks
    >
    > Chris
    =?Utf-8?B?Q2hyaXM=?=, Oct 3, 2005
    #5
    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?U3Rhbg==?=
    Replies:
    1
    Views:
    354
    Steven Cheng[MSFT]
    Feb 27, 2004
  2. Matt
    Replies:
    3
    Views:
    1,104
    aatishp
    Mar 15, 2012
  3. Robin
    Replies:
    0
    Views:
    407
    Robin
    Jun 6, 2007
  4. Gabriel Rossetti
    Replies:
    3
    Views:
    534
    Jerry Hill
    Apr 25, 2008
  5. Ian Bridgeman
    Replies:
    5
    Views:
    131
    Ian Bridgeman
    Nov 26, 2009
Loading...

Share This Page