where to put load of static data?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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