Identifying multiple column names that do not exist in an excel file

According to @Yoichi, it is one of the solutions

First, create string array named names which has column names which is checked.
Then condition of IF is names.All(Function(s) dt.Columns.Contains(s))

And in Else, we can get missing column name from String.Join(",",names.Where(Function(s) not dt.Columns.Contains(s)))

1 Like