i want to remove duplicates only for a single column. please help
Hey @manojmanu.rpa please try this linq query.
dtTable.AsEnumerable.GroupBy(function(x) x(columnname).ToString).Select(function(y) y.First).copytodatatable
It will help you to select the unique value from the column
Regards
Sreejith S S
Thanks @sreejith.ss
These is the input i have to give
and output need to come like this
based on invoicedate col i have to merge commented reasons into one cell, can you please help in that.
Regards,
Manoj
Can you try this
Use in Assign
dt = (From d In dt.AsEnumerable
Group d By k=d("invoicedate").toString.Trim Into grp=Group
Let n = grp.Select(Function (rn) rn("PO").toString).FirstOrDefault
Let s = String.Join(";", grp.Select(Function (rn) rn("Commented").toString).toArray)
Let ra = New Object(){k, s, n}
Select dt.Rows.Add(ra)).CopyToDataTable
dt is the datatable in which data is present
Cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.