Filter Datatable by Column Name?

Hi,

I have datatable from excel data.

How can I use filter Data table to select only column Name start with “img_1_” to new datatable?
Please advise.

Hi,

Cna you try the following expression?

newDT = dt.DefaultView.ToTable("new",false,dt.Columns.Cast(Of DataColumn).Select(Function(c) c.ColumnName).Where(Function(s) s.StartsWith("img_1_")).ToArray())

Regards,

1 Like

It’s work !!!
Thank you for you help.
:+1: :+1:

1 Like

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