I am using LINQ query, but error is showing as Equals Expected.
(From a In Sumif_DT.AsEnumerable()
Join b In MB52_Data_DT.AsEnumerable()
On a.Field(Of String)(“Material”) Equals b.Field(Of String)(“ID”) And
a.Field(Of String)(“Plant”) Equals b.Field(Of String)(“Plant”) And
a.Field(Of String)(“unit”) Equals b.Field(Of String)(“unit”) And
Integer.Parse(a.Field(Of String)(“unrestricted”)) >= Integer.Parse(b.Field(Of String)(“unrestricted”))
Select notvalidmaterial_DT.Rows.Add({a.Field(Of String)(“Material”)})
).CopyToDataTable
(From a In Sumif_DT.AsEnumerable()
Join b In MB52_Data_DT.AsEnumerable()
On a.Field(Of String)("Material") = b.Field(Of String)("ID") And
a.Field(Of String)("Plant") = b.Field(Of String)("Plant") And
a.Field(Of String)("unit") = b.Field(Of String)("unit") And
Integer.Parse(a.Field(Of String)("unrestricted")) >= Integer.Parse(b.Field(Of String)("unrestricted"))
Select notvalidmaterial_DT.Rows.Add({a.Field(Of String)("Material")})
).CopyToDataTable
(From a In Sumif_DT.AsEnumerable()
Join b In MB52_Data_DT.AsEnumerable()
On a.Field(Of String)("Material") Equals b.Field(Of String)("ID") _
And a.Field(Of String)("Plant") Equals b.Field(Of String)("Plant") _
And a.Field(Of String)("unit") Equals b.Field(Of String)("unit") _
And Integer.TryParse(a.Field(Of String)("unrestricted"), unrestrictedA) _
And Integer.TryParse(b.Field(Of String)("unrestricted"), unrestrictedB) _
Where unrestrictedA >= unrestrictedB
Select notvalidmaterial_DT.Rows.Add({a.Field(Of String)("Material")})
).CopyToDataTable
In this corrected query, the && operator is used to combine the conditions for matching the Material, Plant, and unit fields, and Integer.TryParse is used to safely parse the integer values from the fields unrestricted of Sumif_DT and MB52_Data_DT. The records will be filtered based on the condition unrestrictedA >= unrestrictedB.
Please note that you should replace unrestrictedA and unrestrictedB with appropriate variable names (e.g., unrestrictedA could be aUnrestricted and unrestrictedB could be bUnrestricted) to store the parsed integer values.
(From a In Sumif_DT.AsEnumerable()
Join b In MB52_Data_DT.AsEnumerable()
On a.Field(Of String)(“Material”) Equals b.Field(Of String)(“ID”) And a.Field(Of String)(“Plant”) Equals b.Field(Of String)(“Plant”) And a.Field(Of String)(“unit”) Equals b.Field(Of String)(“unit”) And Integer.TryParse(a.Field(Of String)(“unrestricted”), unrestrictedA) Equals Integer.TryParse(b.Field(Of String)(“unrestricted”), unrestrictedB)
Where unrestrictedA >= unrestrictedB
Select notvalidmaterial_DT.Rows.Add({a.Field(Of String)(“Material”)})
).CopyToDataTable
(From a In Sumif_DT.AsEnumerable()
Join b In MB52_Data_DT.AsEnumerable()
On a.Field(Of String)(“Material”) Equals b.Field(Of String)(“ID”) And a.Field(Of String)(“Plant”) Equals b.Field(Of String)(“Plant”) And a.Field(Of String)(“unit”) Equals b.Field(Of String)(“unit”)
Where CInt(a.Field(Of String)(“unrestricted”))>= CInt(b.Field(Of String)(“unrestricted”))
Select notvalidmaterial_DT.Rows.Add({a.Field(Of String)(“Material”)})
).CopyToDataTable