Need a Linq query

Hello everyone,

I need a Linq query for below scenario
Sample DataTable:

Column A Column B Column C
X Y Z
A B C

I know the value of (Column A+Column B) which is XY
I want compare this XY with this datatable columns A and B. Then I want to retrieve the value of Column C.

In this case, I want the output=Z

Can you please help me?

Thanks,

Lets assume that all combinations from ColA and ColB are unique

We can shortcut when creating a LookUpDirectory

Assign Activity
dictLK = Dictionary(Of String,String) =

dtData.AsEnumerable.ToDictionary(function (x) String.Format("{0}_{1}", x(0).toString.Trim, x(1).toString.Trim), Function (x) x(2).ToString.Trim)

then we can use the dictLK like
strValue = dictLK(“X_Y”) which will return Z

And for a defensive Access we can check the key presence by
dictLK.ContainsKey(“X_Y”)

feel free to adapt by key building logic e.g with a toupper…