TOP 2 salary in LINQ

  1. DataContext context = new DataContext();  
  2. var q= context.tblEmployee.GroupBy(ord => ord.Salary)  
  3. .OrderByDescending(f => f.Key)  
  4. .Skip(1) //second, third ..nth highest salary where n=1,2...n-1  
  5. .First()  
  6. .Select(ord=>ord.Salary)  
  7. .Distinct();