I have an IEnumerable of this type of class ColumnInfo
namespace MyCompany
{
public class ColumnInfo
{
public int Id { get; set; }
public string Description { get; set; }
public int DisplayOrder { get; set; }
public string ColumnName { get; set; }
}
}
In this class I have a ColumnName property that shows me string column names.
I have already a populated DataTable with some columns.
I need to remove columns from the data table that are not in my IEnumerable with property ColumnName. I need in my datatable only the columns that I have listed in the ColumnName property.