As the title says, is there any way to retain only the columns that contain a specific keyword in their column name, without iterating through? I have thousands of columns, so that’s why I’d like to avoid looping.
I can’t seem to do this with LINQ, I tried something like this…
(From x In dt_Test.Columns.Cast(Of DataColumn)
Where x.ColumnName.ToLower.Contains("my specific keyword")
Select x).CopyToDataTable
This seems to return a collection of datacolumns which the “CopyToDataTable” is not a method of, so here’s where I’m stuck. Any help would be greatly appreciated.