On e("EmployeeID").ToString.Trim Equals s("EmployeeID").toString.Trim
UPD1 - Additional hints
when the issue persist then:
check all column datatypes from dtEmployees, dtSalaries
ensure that there are of same type and dtJoin has modell it as the same
try the following:
(From e In dtEmployees.AsEnumerable()
Join s In dtSalaries.AsEnumerable()
On e("EmployeeID").ToString.Trim Equals s("EmployeeID").toString.Trim
Let ra = new Object(){e("EmployeeID"),e("Name"), s("Salary") }
Select r=dtJoined.LoadDataRow(ra, False)).CopyToDataTable()
can you try with below code. incase if your row having no value it will skip it.
Dim query =
From e In dtEmployees.AsEnumerable()
Join s In dtSalaries.AsEnumerable()
On e.Field(Of String)(“EmployeeID”) Equals s.Field(Of String)(“EmployeeID”)
Select dtJoined.LoadDataRow(New Object() {
e.Field(Of String)(“EmployeeID”),
e.Field(Of String)(“Name”),
s.Field(Of Decimal)(“Salary”)
}, False)
Dim joinedData = query.CopyToDataTable()
Hope it helps!!!