如果你熟悉SQL语句,当使用LINQ时,会有似曾相识的感觉.但又略有不同.下面是SQL和LINQ,Lambda语法对照图 SQL LINQ Lambda SELECT * FROM HumanResources.Employee from e in Employees select e Employees.Select (e => e) SELECT e.LoginID, e.JobTitle FROM HumanResources.Employee AS e from e in Employe
1.查询Student表中的所有记录的Sname.Ssex和Class列. SQL:select sname,ssex,class from Students linq:from s in Students select new{s.sname,s.ssex,s.class} lambda:Students.select(s=>new{sname=s.sname,ssex=s.ssex,class=s.class}) 2.查询教师所有的单位即不重复的Depart列. SQL:select dis