Comparing two variables when joining tables

I am trying to joint two tables, but I can not get it to work. After some investigation I found that the two variables are not equal even though they are the same visually as well as types of said variables are the same as well.

output for dt_SQL.Rows(0)(23).ToString - 95049482
output for dt_vagonas.Rows(0)(0).ToString - 95049482
output for (dt_SQL.Rows(0)(23).ToString = dt_vagonas.Rows(0)(0).ToString).ToString - False

Any idea on how to fix this?

Hi @Tadas ,

Could you try trimming it as well and then compare the two?

(dt_SQL.Rows(0)(23).ToString.Trim = dt_vagonas.Rows(0)(0).ToString.Trim)

Kind Regards,
Ashwin A.K

1 Like

we can check for Using LINQ

in General
dtJoinResultLeft =

(From d1 in dt1.AsEnumerable
Join d2 in dt2.AsEnumerable
On d1(0).toString.Trim Equals d2(23).toString.Trim
Select r=d1).CopyToDataTable

On which output from Join are interested in detail?

Thank you, that helped :slight_smile:

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