views:

455

answers:

2

I have a Linqdatasource that groups the records in table:Routing by a field called SubmitTo. My select statement is this - "new (key as SubmitTo, Count() as Count, it as Routings)". Now the SubmitTo field is only a foreign key reference the primary key in table:Department which has a field:DeptName with the full name of the department. How do I reference that field:DeptName after I bound the linqdatasource to a gridview? I tried "Department.DeptName" but it is not working. I tried bounding the linqdatasource without using groupby and the reference "Department.DeptName" works.

Thanks in advance for the help

A: 

The simplest answer I can think of would be to join the tables, then group by Department.DeptName rather than the SubmitTo field. I don't know if there's an easier way though.

-MBirchmeier

MBirchmeier
A: 

Could you use this?

new (key as SubmitTo, key.DeptName as DeptName, Count() as Count, it as Routings)

Jonathan Bates