如何用(连接,分组和条件)编写linq查询 [英] How to write linq queries with ( Joins, Group by and Where Conditions)
问题描述
我的Sql查询是
SELECT Count(dbo.StudentAttendancechild.Status), dbo.StudentAttendancechild.AttendanceID,dbo.StudentAttendancechild.AdmissionNo,
dbo.StudentAttendanceMaster.Class,dbo.StudentAttendanceMaster.Date
来自dbo.StudentAttendancechild INNER JOIN
dbo.StudentAttendanceMaster ON dbo.StudentAttendancechild.AttendanceID = dbo.StudentAttendanceMaster.ID
其中dbo.StudentAttendancechild.Admission ='111'和dbo.StudentAttendancechild.Status ='现在'
group by dbo.StudentAttendancechild.AdmissionNo,dbo.StudentAttendanceMaster.Class,dbo.StudentAttendanceMaster.Date,dbo.StudentAttendancechild.AttendanceID
可以任何人帮我在LINQ写查询
先谢谢........................
有很多文章和视频 [ ^代码项目,这里有很好的解释和LINQ的例子。
这是一个:
LINQ简介第1部分,共3部分 [ ^ ]
My Sql Query is
"SELECT Count(dbo.StudentAttendancechild.Status),dbo.StudentAttendancechild.AttendanceID, dbo.StudentAttendancechild.AdmissionNo,
dbo.StudentAttendanceMaster.Class, dbo.StudentAttendanceMaster.Date
FROM dbo.StudentAttendancechild INNER JOIN
dbo.StudentAttendanceMaster ON dbo.StudentAttendancechild.AttendanceID = dbo.StudentAttendanceMaster.ID
where dbo.StudentAttendancechild.Admission='111' and dbo.StudentAttendancechild.Status='Present'
group by dbo.StudentAttendancechild.AdmissionNo, dbo.StudentAttendanceMaster.Class,dbo.StudentAttendanceMaster.Date,dbo.StudentAttendancechild.AttendanceID"
can Any one help me to write query in LINQ
Thanks in Advance........................
There are many articles and videos[^] here on Code Project that have great explainations and examples for LINQ.
Here is one:
LINQ Introduction Part 1 Of 3[^]
这篇关于如何用(连接,分组和条件)编写linq查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!