PC Review


Reply
Thread Tools Rate Thread

Database Table Verses DropDownList

 
 
Leon
Guest
Posts: n/a
 
      22nd Oct 2004
What is the best way to store small sets of look-up data for my web
application in the database (sql2000) or in a dropdownlist control in my web
form?
Or is it a question of how much data I want to type over and over again.

Example:
TableName - YearMonths
MonthID (1, 2, 3, 4, etc)
YearMonth (Jan, Feb, Mar, Apr, etc)

TableName - Gender
GenderID (M, F)
Description (Male, Female)

TableName - MonthDate
MonthDate (1, 2, 3, 4,......31)

Note: All Interaction with the database is done from the web Interface.

Thanks!



 
Reply With Quote
 
 
 
 
Peter van der Goes
Guest
Posts: n/a
 
      22nd Oct 2004

"Leon" <(E-Mail Removed)> wrote in message
news:O74Xa%(E-Mail Removed)...
> What is the best way to store small sets of look-up data for my web
> application in the database (sql2000) or in a dropdownlist control in my

web
> form?
> Or is it a question of how much data I want to type over and over again.
>
> Example:
> TableName - YearMonths
> MonthID (1, 2, 3, 4, etc)
> YearMonth (Jan, Feb, Mar, Apr, etc)
>
> TableName - Gender
> GenderID (M, F)
> Description (Male, Female)
>
> TableName - MonthDate
> MonthDate (1, 2, 3, 4,......31)
>
> Note: All Interaction with the database is done from the web Interface.
>
> Thanks!
>
>

One way to look at it is persistence. If the lookup values can change
between program runs, then the values should be stored in your database and
updated as necessary. If (as in your examples) the values are truly
constant, and very unlikely to change over time, then putting them directly
in your dropdown lists makes sense.
For example a table of local sales tax rates within a state should be in a
table, as rates change over time. The value of PI and e, OTOH, can be in
your code.

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


 
Reply With Quote
 
Leon
Guest
Posts: n/a
 
      22nd Oct 2004
So What about like States (AK, AL, CA, etc.)?
Do you store states in the database or code?

"Peter van der Goes" <(E-Mail Removed)> wrote in message
news:%23bX$(E-Mail Removed)...
>
> "Leon" <(E-Mail Removed)> wrote in message
> news:O74Xa%(E-Mail Removed)...
>> What is the best way to store small sets of look-up data for my web
>> application in the database (sql2000) or in a dropdownlist control in my

> web
>> form?
>> Or is it a question of how much data I want to type over and over again.
>>
>> Example:
>> TableName - YearMonths
>> MonthID (1, 2, 3, 4, etc)
>> YearMonth (Jan, Feb, Mar, Apr, etc)
>>
>> TableName - Gender
>> GenderID (M, F)
>> Description (Male, Female)
>>
>> TableName - MonthDate
>> MonthDate (1, 2, 3, 4,......31)
>>
>> Note: All Interaction with the database is done from the web Interface.
>>
>> Thanks!
>>
>>

> One way to look at it is persistence. If the lookup values can change
> between program runs, then the values should be stored in your database
> and
> updated as necessary. If (as in your examples) the values are truly
> constant, and very unlikely to change over time, then putting them
> directly
> in your dropdown lists makes sense.
> For example a table of local sales tax rates within a state should be in a
> table, as rates change over time. The value of PI and e, OTOH, can be in
> your code.
>
> --
> Peter [MVP Visual Developer]
> Jack of all trades, master of none.
>
>



 
Reply With Quote
 
scorpion53061
Guest
Posts: n/a
 
      22nd Oct 2004
I always load them into ArrayLists from a database or datatable at
startup.

"Leon" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed):
> So What about like States (AK, AL, CA, etc.)?
> Do you store states in the database or code?
>
> "Peter van der Goes" <(E-Mail Removed)> wrote in message
> news:%23bX$(E-Mail Removed)...
> >
> > "Leon" <(E-Mail Removed)> wrote in message
> > news:O74Xa%(E-Mail Removed)...
> >> What is the best way to store small sets of look-up data for my web
> >> application in the database (sql2000) or in a dropdownlist control in
> >> my

> > web
> >> form?
> >> Or is it a question of how much data I want to type over and over
> >> again.
> >>
> >> Example:
> >> TableName - YearMonths
> >> MonthID (1, 2, 3, 4, etc)
> >> YearMonth (Jan, Feb, Mar, Apr, etc)
> >>
> >> TableName - Gender
> >> GenderID (M, F)
> >> Description (Male, Female)
> >>
> >> TableName - MonthDate
> >> MonthDate (1, 2, 3, 4,......31)
> >>
> >> Note: All Interaction with the database is done from the web
> >> Interface.
> >>
> >> Thanks!
> >>
> >>

> > One way to look at it is persistence. If the lookup values can change
> > between program runs, then the values should be stored in your database
> >
> > and
> > updated as necessary. If (as in your examples) the values are truly
> > constant, and very unlikely to change over time, then putting them
> > directly
> > in your dropdown lists makes sense.
> > For example a table of local sales tax rates within a state should be in
> > a
> > table, as rates change over time. The value of PI and e, OTOH, can be
> > in
> > your code.
> >
> > --
> > Peter [MVP Visual Developer]
> > Jack of all trades, master of none.
> >
> >


 
Reply With Quote
 
Leon
Guest
Posts: n/a
 
      22nd Oct 2004
Cool Thanks!

"scorpion53061" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I always load them into ArrayLists from a database or datatable at
> startup.
>
> "Leon" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed):
>> So What about like States (AK, AL, CA, etc.)?
>> Do you store states in the database or code?
>>
>> "Peter van der Goes" <(E-Mail Removed)> wrote in message
>> news:%23bX$(E-Mail Removed)...
>> >
>> > "Leon" <(E-Mail Removed)> wrote in message
>> > news:O74Xa%(E-Mail Removed)...
>> >> What is the best way to store small sets of look-up data for my web
>> >> application in the database (sql2000) or in a dropdownlist control in
>> >> my
>> > web
>> >> form?
>> >> Or is it a question of how much data I want to type over and over
>> >> again.
>> >>
>> >> Example:
>> >> TableName - YearMonths
>> >> MonthID (1, 2, 3, 4, etc)
>> >> YearMonth (Jan, Feb, Mar, Apr, etc)
>> >>
>> >> TableName - Gender
>> >> GenderID (M, F)
>> >> Description (Male, Female)
>> >>
>> >> TableName - MonthDate
>> >> MonthDate (1, 2, 3, 4,......31)
>> >>
>> >> Note: All Interaction with the database is done from the web
>> >> Interface.
>> >>
>> >> Thanks!
>> >>
>> >>
>> > One way to look at it is persistence. If the lookup values can change
>> > between program runs, then the values should be stored in your database
>> >
>> > and
>> > updated as necessary. If (as in your examples) the values are truly
>> > constant, and very unlikely to change over time, then putting them
>> > directly
>> > in your dropdown lists makes sense.
>> > For example a table of local sales tax rates within a state should be
>> > in
>> > a
>> > table, as rates change over time. The value of PI and e, OTOH, can be
>> > in
>> > your code.
>> >
>> > --
>> > Peter [MVP Visual Developer]
>> > Jack of all trades, master of none.
>> >
>> >

>



 
Reply With Quote
 
Peter van der Goes
Guest
Posts: n/a
 
      22nd Oct 2004

"Leon" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> So What about like States (AK, AL, CA, etc.)?
> Do you store states in the database or code?
>

I'm with Scorpion on this for two reasons:
1) There are 50 states, plus DC and territories. If you add Canadian
provinces, etc., that's a fair amount of data.
2) This data can and will change over time. There are now two recognized
abbreviations for some Canadian provinces, one English, the other French.

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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
statistical database attack verses defense for online game Kathleeen Microsoft Excel Programming 0 13th Mar 2010 08:08 PM
Add new row to binded Dropdownlist retrieved from database table dungdang Microsoft ASP .NET 2 13th Jun 2007 03:27 PM
Database Table Verses DropDownList Leon Microsoft ASP .NET 4 22nd Oct 2004 03:22 PM
Re: Default dropdownlist to database value alien2_51 Microsoft ASP .NET 0 9th Aug 2003 12:22 AM
Re: Default dropdownlist to database value Michal A. Valasek Microsoft ASP .NET 0 8th Aug 2003 11:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:50 AM.