How to delete/remove rows from a datatable based on a List using Linq

Hello Good people,

Kindly help me with a linq query that can delete a desired list from a datatable for example

Your removing a list of {Issue date,Description,Safety risky,Remedy,Campaign/NHTSA#}

Kindly assist.
Thank you in advance.

Best Regards,
Kakooza Allan Klaus

1 Like

we do see a relationship to your other topics but will scope the answer to this topic case request

  • currently with the give set we would get the same result when we filter all rows on second column value: …-content

Working with a list we can do:

arrRemoveList = {Issue date,Description,Safety risky,Remedy,Campaign/NHTSA#}

Assign Activity:

dtFiltered | datatype: DataTable =
(From d in YourDataTableVar.AsEnumerable
Let a = d("Column1").toString.Trim
Where Not arrRemoveList.Contains(a)
Select r = d).CopyToDataTable

Thanks alot @ppr
Highly appreciate

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.