I have a data table structure as seen below. This is booking data and each day is it’s own row in the datatable where the first row in each person group is the start date and time of the booking and the end date of the booking are on the last row in the group.
(From d In TestDT.AsEnumerable
Group d By k=d("Occupant").toString.Trim Into grp=Group
Let ra = New Object(){k,grp.First()("Booking Start Date"),grp.First()("Booking Start Time"),grp.Last()("Booking End Date"),grp.Last()("Booking End Time")}
Select ResDT.Rows.Add(ra)).CopyToDataTable
Build a Datatable (ResDT) with all columns and Assign above linq to it