Dropdown Listbox date value

  • Thread starter Thread starter James W. Hall Sr.
  • Start date Start date
J

James W. Hall Sr.

I am filling a dropdown listbox in ASP.NET. The display value is a date
field from SQL Server. When I bind the data to the dropdown listbox the
time appears in with the data (12:00 am). In the database it appear
12/31/2003. It appears in the control as 12/31/2003 12:00 am. I am
trying to format the field in the select statement with no luck. Can
anyone help me?

James W. Hall Sr.
 
You can specify the format string using the
DataTextFormatString property i.e. {0:"d"}

Tu-Thach
 
I tried using the datatextformatstring as you stated. I get an error
converting string to date when I selectvalue. Do you have any
suggestions? The display value is the date the value is weekid, which
is integer.

James W. Hall Sr.
 
Thank you for your time. It worked without the " but you did need the
{}.

James W. Hall Sr.
 
Back
Top