Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seeking Dropdown Advice

Status
Not open for further replies.

spizotfl

MIS
Aug 17, 2005
345
US
Hi all, I am working on a Data Entry project in VS 2005, so .Net 2.0. Some of the pages will have quite a few dropdown lists that get their values from a database. I was wondering how people usually handle this situation when they face it?
There will be 4 people regularly inserting data in the system. The lookup values shouldn't change terribly often (should only change yearly, but could be more often), but they need to be easily update-able.
I am sure there is something useful that I can add, but I am not sure, so please ask for clarification.
Thanks

"Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything."
-Vonnegut
 
If you are filling ddls with values that will not change often, then I would load the values into cache.
 
I like to use the concept of units of works (and ultimately my database connections). this is very popular with ORM's like ActiveRecord and Nhibernate. with asp.net it's very simple to delineate a unit of work with the request/response pair.

with mature ORM's you can also take advantage of aggrgating db calls and data caching.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Ok, I've had some time to look at caching but I am having problems. The form that I am populating has 33 DropDownLists that are populated from database tables. There are 25 unique lists, 4 of which are reused to populate 3 DropDownLists each.

Currently I use simple wrapper classes with fields that map to the the database tables. In the DAL I use a datareader to fill the wrapper class that is then inserted into a generic List<>. I return this list to the front end, bind it to the dropdownlist, and store it in cache, if not there already. When I had roughly half of the dropdownlists pulling their data, everything worked fine, but once I finished setting them all up, the webserver crashed (both the built in one is Visual Studio, and IIS in XP).

I am pretty sure that the issue is that between the wrapper classes and the generic Lists I am wasting a ton of memory.

I need some advice on how to make this more lightweight or how to manage this much better. I am not far from removed from being a complete newb, but I don't mind reading if you have any recommended links. Unfortunately my googling has only shown basics of how to load DropDownLists, nothing to complicated.

Thanks for any help

"Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything."
-Vonnegut
 
Forget it. I'm just really dumb. Didn't notice that I had accidently set the DataBinding event for one of the DropDowns to Page_Load.

"Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything."
-Vonnegut
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top