我想收集所有行并将其传递给datatable。我的linq查询:
var queryAll = from all in db.tblMake select all ;
DataTable dt = new DataTable();
如何将queryAll传递给datatable dt?
如果我尝试:
IEnumerable<DataRow> queryAll = from all in db.tblMake.AsEnumerable() select all;
出现错误:
Cannot Implicitely Convert type 'System.Collection.Generic.IEnumerable<Workshop2s.Models.tblMake>' to 'System.Collection.Generic.IEnumerable<System.Data.DataRow>'