Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: dropdown list ?


Message #1 by "Tim Farrell" <timothy.farrell@c...> on Tue, 17 Dec 2002 14:53:52
I have a dropdown list that contains some dates.  The dropdown list is 
populated from a SQl2000 database.

I want to have the first value of the list be a null value.  Does anyone 
know how I can do this?  In other words the list might look like this:

--------
04/12/02
04/28/02

Thank you for your help.

Sincerely,

Tim
Message #2 by "Peter Lanoie" <planoie@n...> on Tue, 17 Dec 2002 13:15:41 -0500
Can you use one of the dropdown list methods to add or insert a value to a
specific location?  Like inserting into the beginning of the list that
"blank" value you want.

Other option might be to do a union in your SQL:

	select null, '--------'
	union
	select date, date from myDateTable

Something like that.  the first field is your option value, and the second
the option text.  Then you just bind that query and you have that first null
option.  You'll probably have to do a convert on the date for the column in
which you explicit output your text for the null option.  Here's a quick
test query I did that worked ok.

	select null, '--------'
	union
	select getdate(), convert(varchar(20), getdate())


-----Original Message-----
From: Tim Farrell [mailto:timothy.farrell@c...]
Sent: Tuesday, December 17, 2002 14:54
To: aspx_beginners
Subject: [aspx_beginners] dropdown list ?


I have a dropdown list that contains some dates.  The dropdown list is
populated from a SQl2000 database.

I want to have the first value of the list be a null value.  Does anyone
know how I can do this?  In other words the list might look like this:

--------
04/12/02
04/28/02

Thank you for your help.

Sincerely,

Tim


  Return to Index