Linq to Select first few columns using index in datatable

Hi @Ray_Sha1

How about this expression?

New DataTable → DtOutput

(From d In Dt.AsEnumerable
let ra = d.ItemArray.Take(9).toArray
Select DtOutput.Rows.Add(ra)).CopyToDataTable

Regards
Gokul

2 Likes