Good afternoon,
I have a dataset that countain 1 table with 2 columns "HOLIDAY_DATE" and "HOLIDAY_NAME" with about 25 rows....
I need to bind this dataset to a DropDownList and concatenate the "HOLIDAY_DATE" (DateTime Type) & " " & "HOLIDAY_NAME" (String)
I tried the following code below which kinda works... BUT... IT GIVES ME 01/01/2014 - 00:00:00 New Year
But what I am looking for is the date formatted as {0:MMMM d, yyyy} in order to get January 1st 2014 - New Years
So what I am looking to achieve is formatted "HOLIDAY_DATE" as {0:MMMM d, yyyy} & " " & "HOLIDAY_NAME" ----> January 1st 2014 - New Year
Any help would be much appreciated..
Thanks!
I have a dataset that countain 1 table with 2 columns "HOLIDAY_DATE" and "HOLIDAY_NAME" with about 25 rows....
I need to bind this dataset to a DropDownList and concatenate the "HOLIDAY_DATE" (DateTime Type) & " " & "HOLIDAY_NAME" (String)
I tried the following code below which kinda works... BUT... IT GIVES ME 01/01/2014 - 00:00:00 New Year
But what I am looking for is the date formatted as {0:MMMM d, yyyy} in order to get January 1st 2014 - New Years
Code:
dsHolidays.Tables(0).Columns.Add("DisplayText", GetType(string))
dsHolidays.Tables(0).Columns("DisplayText").Expression = "HOLIDAY_DATE + ' - ' + HOLIDAY_ID"
Me.ddlAddHoliday.DataSource = dsHolidays.Tables(0)
Me.ddlAddHoliday.DataTextField = "DisplayText"
Me.ddlAddHoliday.DataValueField = "HOLIDAY_DATE"
Me.ddlAddHoliday.DataBind()
Any help would be much appreciated..
Thanks!