Using Linqdatasource and groupby Properties

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

+3
source share
2 answers

The simplest answer I can imagine is to join the tables and then add a group Department.DeptName, not a field SubmitTo. I do not know if there is an easier way.

0
source

Could you use this?

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

0
source

Source: https://habr.com/ru/post/1703537/


All Articles