How to populate DataTable with anonymous LINQ result

前端 未结 3 413
误落风尘
误落风尘 2020-12-21 00:49

I have the following LINQ query:

var timesheets = from timesheet in entities.Timesheets
    join timesheetTask in entities.Timesheet_Task on timesheet.Id e         


        
3条回答
  •  误落风尘
    2020-12-21 01:48

    Call .ToList().
    The resulting List can also be bound to a DataGridView, and is easier to work with than a DataTable.

提交回复
热议问题