« Return to Thread: VWP - dropDown bound to DB question

Re: VWP - dropDown bound to DB question

by Don Albertson-2 :: Rate this Message:

Reply to Author | View in Thread

Paul Belleville said (on or about) 02/14/2007 14:39:
> What if I have a dropDown bound to a DB table so it provides the choices.
> However, I also want to add an empty selection since null is a valid
> choice for this field in which this data will eventually be saved.
> I guess I can add a null to the selection DB table.. is there a better way?
>  
> Paul

I usually begin my dropDown lists and comboBoxes with a String
that says "<Select Something From This List>".  If that is
the selected Object from the list, then somewhere in my code
there will be a way to handle the fact that what was selected
(or not selected) isn't a value that matches in the db and
my code will ensure that the db value is set to NULL.

I find NULL values need extra care in many places.  For example
if the db column is a number column and the value is NULL
ResultSet.getLong() will return 0 which is not quite the same
thing as NULL.


 « Return to Thread: VWP - dropDown bound to DB question