Select a value from a data table referring to a specific value in another column

Hi,

I have this Table:

image

I want to extract the value from the Detail Column where that Status=“Referral”

Can I use a LINQ query for this?
Thanks for helping.

HI,

How about the following?

arrResult = dt.AsEnumerable.Where(Function(r) r("Status").ToString="Referral").Select(Function(r) r("Detail").ToString).ToArray()

Sample
Sample20240517-1.zip (9.6 KB)

Regards,

1 Like

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