I want to split into another table base on “item” & “Number” Cols
The Condition: The values at “Number” Col are < 0 and The values at “item” are same.
I have used linQ code as below but it printed result not correct.
Where is mistake in my code?
Thanks in advance!
(From d In table.AsEnumerable
Group d By k=d(“item”).toString.Trim(), k1 = Convert.ToDouble(d(“Number”).toString.Trim) < 0 Into grp=Group
Where grp.Count > 1
Select grp.ToList).SelectMany(Function (x) x).CopyToDataTable
What if there are negative value at “Number” column in No.6 and 8 row? Do you want to output to still single datatable or two datatables for each item?