Home > Net >  Linq multi-table LianZha with group by group, how to do
Linq multi-table LianZha with group by group, how to do

Time:04-10

StudentDataContext stu=new studentDataContext ();

This. GridView1. The DataSource=the from p in stu. Student
The join g in stu. ClassInfo on p.C lassId equals right lassId
Group, a new {p.N ame, right lassName} by right lassName
Select new into k {class=k.K ey, name=};

This. GridView1. DataBind ();



Point out the Name Name behind

CodePudding user response:

Class=k.K ey ClassName, Name=k.K ey. Name

CodePudding user response:

reference 1st floor caozhy response:
class=k.K ey. ClassName, Name=k.K ey. Name


No, points out the key behind

CodePudding user response:

Wrong
Select new {class=k.K ey, Name=k.F irst (). The Name};

CodePudding user response:

The
reference 3 floor caozhy response:
wrong
Select new {class=k.K ey, Name=k.F irst (). The Name};

This is to be able to point out, but can only find out the first data, is there any way to find out all the

CodePudding user response:

Select new {class=k.K ey, name=Keith well (stu=& gt; Stu. Name)};

CodePudding user response:

Still won't do
I have already solved

CodePudding user response:

How to solve
  •  Tags:  
  • LINQ
  • Related