Copy row from datatable containing specific string without using column name

datatable

#1

Hi,

I’m trying to simply copy rows from a datatable containing specific strings wihout using column names.

I looked around and could not find a simple and straightforward answer.

Could anybody help me out?

Cheers!


#2

@Daniel_M

Let us take you datatable as dta

DataTable dtb= (From row In dta.Select
where row.ItemArray.Contains(“Specific_String”)
Select row).ToArray.CopyToDataTable

now dtb will contain only datarows which are containing specific keyword.

Regards,
Mahesh


#3

Thank you MAHESH1, that did the trick!