Hi, I have an Comma Separated string and I’m looking to remove any rows from a datatable where a column value is equal to one of the items in the string.
I can get it working if I’m looking to keep the columns, but don’t know how to do it if I want to remove the columns.
I’m using this:
(From r In dt.AsEnumerable From s In Variable.split(","C) Where not r(ColumnName).toString.contains(s) Select r).CopyToDataTable
But it doesn’t give me the desired result.
As an example
If Variable = “Tim,Tom,John”
and my Datatable is
FirstName
Tim
Tom
Tim
John
Chris
Jim
I would expect:
FirstName
Chris
Jim
Any help is greatly appreciated! Thanks