all groups > dotnet academic > april 2005 >
You're in the

dotnet academic

group:

list control bind source - best practice


list control bind source - best practice Larry Foulkrod
4/5/2005 1:19:04 PM
dotnet academic:
For the following scenario:

"I am populating a drop down list control with 5-10 items of static data.
This list control will appear in several ASP.NET pages."

What is the best practice? Should I,
a) Just add the items directly in the code?
b) Create an XML file with the items?
c) Store the items in a database?
d) Create a struct type with the items as properties?
e) Use a different method?

Thanks in advance for your help.

Re: list control bind source - best practice Peter van der Goes
4/6/2005 6:47:04 AM

[quoted text, click to view]

Think in terms of data volatility. Just how nonvolatile are the entries?
Sales tax rates, for example, are nonvolatile in the context of using
software on any given day, but do change over time. OTOH, the value of PI is
a true constant (at least, during my lifetime).
Any technique which embeds the data in your code costs more to maintain
unless you are dealing with true constants. Given the small number of data
items you've cited, any convenient external storage method would work.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.

AddThis Social Bookmark Button