How to delete the first 10 data columns of a data table?

Hello!

Just a quick question. I have a data table with 30 data columns. I want to delete the first 10 data columns. How can I do it? Or is this possible with a linq query? Thank you!

Hi @_pjflo

You want to delete first10 columns, or first 10 rows

Regards!

Hi! the first 10 columns. I need to extract column 11 through 30.

How about the following?
image

Regards!

1 Like

Hi,

Or is this possible with a linq query?

Can you try the following expression?

newDt = dt.DefaultView.ToTable(False,dt.Columns.Cast(Of DataColumn).Select(Function(dc) dc.ColumnName).Skip(10).ToArray)

Regards,

2 Likes

Thanks for your help, @Yoichi !

1 Like

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