concantenating fields in a drop down

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Posts: 6
Joined: Fri 27 Mar 2009 01:38

concantenating fields in a drop down

Post by mainship » Tue 31 Mar 2009 17:24

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


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

DDLArriveDay.DataSource = qa

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?


Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 02 Apr 2009 13:50

Could you please send me a small test project illustrating the problem?
I failed to reproduce this problem in my environment.

Post Reply