Find or match the string value with the rows of data table and extract value of that row using linq query

hello,
I have a scenario where i have a string value and i need to find the exact match of that string value in a data table column ex : Dt1 with column name Oldurl if there is a match i need to extract corresponding row value also i need to extract the next column value for that particular row ex newurl column value. How can i achieve this using linq querry

Hi @sanjay_gowda

Try this linq:

result = Dt1.AsEnumerable().Where(Function(row) row.Field(Of String)("Oldurl") = "your_search_string_here").Select(Function(row) row.Field(Of String)("Newurl")).FirstOrDefault()

Regards

Just use the Filter Data Table activity. This is what it’s designed for.

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