I want to collect all rows and pass it to datatable. My linq query:
var queryAll = from all in db.tblMake select all ;
DataTable dt = new DataTable();
How can i pass the queryAll into datatable dt?
If i try :
IEnumerable<DataRow> queryAll = from all in db.tblMake.AsEnumerable() select all;
comes with error:
Cannot Implicitely Convert type 'System.Collection.Generic.IEnumerable<Workshop2s.Models.tblMake>' to 'System.Collection.Generic.IEnumerable<System.Data.DataRow>'