I have a dropdown list that's populated by a database. It displays all the dates that are valid for a user's selection. It currently displays a dateTime field called dDate. I have another field called DOW that contains the day of week associated with the date in dDate. I want the drop down to display DOW-dDate.
In my markup I have
and
I'm using Linq to sql. In my code behine I have
Dim db As New ReservationsDataContext
Dim qd = From d In db.Inventories _
Where d.Depart = DDLFrom.SelectedValue And d.GoesTo.Contains(sSearchTo) _
Order By d.dDate _
Select _
DepartDay = d.DOW & "-" & d.dDate
Dim qa = From r In db.Inventories _
Where r.Depart = DDLTo.SelectedValue And r.GoesTo.Contains(sSearchFrom) _
Order By r.dDate _
Select _
DepartDay = r.DOW & "-" & r.dDate
DDLLeaveDay.DataSource = qd
DDLLeaveDay.DataBind()
DDLArriveDay.DataSource = qa
DDLArriveDay.DataBind()
I'm getting the error: System.Web.HttpException: DataBinding: 'System.String' does not contain a property with the name 'DepartDay'. on ther bold line above. What step am I missing?
Diane