How to remove every columns after a specific index (C# or VB)

Hi @indiedev91

Try this

dt = dataTable.DefaultView.ToTable(False, dataTable.Columns.Cast(Of DataColumn).Take(17000).Select(Function(c) c.ColumnName).ToArray())

2 Likes