查询主体必须以select子句或group子句结束

时间:2009-07-07 02:00:17

标签: linq-to-sql

    var result = from lr in _db.LeaveRequest  
                 join th in _db.TotalHourslu    
                 on lr.TotalHoursEffect 
                 equals th.Minutesselect 
                     new {lr.TotalHoursEffect, th.Minutes, tr.Display};

错误:在

1 个答案:

答案 0 :(得分:1)

你忘记了select;试试这个:

var result = from lr in _db.LeaveRequest  
             join th in _db.TotalHourslu    
               on lr.TotalHoursEffect equals th.Minutesselect 
             select new {lr.TotalHoursEffect, th.Minutes, tr.Display};