Select columns from data table where column name exists in list of string

Hi Experts

I have a data table that contains columns named “Column A”, “Column B”, “Column C”, “Column D” and “Column E” and a list of strings that has the list items “Column A” and “Column E”.

How can I select only the columns from the data table where the column name exists in the list of strings and output as a new data table?

I am not sure if the Filter Data Table activity supports that so my idea was to use LINQ. Just not sure how to write that expression.

arrCols = { “Column A”,“Column E”}

dtMini = dtOrig.DefaultView.ToTable(false, arrCols)

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