Multiply columns value from one table to another table

Hello Everyone,

I have 2 Data tables, if Column A of Table 1 equals to Column B of Table 2 then multiply Column X of Table 1 and Column Y of Table 2 then place new value in Column Z of Table 1.

Could someone help me with LINQ Query.

Thanks in Advance.

LINQ is not my strong suit, but luckily chatGPT is:

How to Update Data Column Values of a Data Table | Community Blog

As a selective Data Column Value update is needed, a misused LINQ can increase the Black-Box risk.

However we can model it with a lookup strategy and within a hybrid approach

Assign activity:
dictLK | Dictionary(Of String, Double) =

dt2.AsEnumerable.ToDictionary(Function (x) x("B").ToString.Trim, Function (x) CDbl(x("Y").toString.Trim))

Implementing the work only on the Subset Approach

For each Activity (NOT for each row in datatable activity) | TypeArguement: DataRow
| item in dt1.AsEnumerable.Where(Function (x) dictLK.ContainsKey(x("A").toString.Trim))
++ Assign Activity:
item("Z") = CDbl(item("X").toString.Trim) * dictLK(item("A").toString.Trim)