Share via


'Equals' cannot compare a value of type <type1> with a value of type <type2>

An Equals operator in a Join or Group Join clause has attempted to compare one data type to another in a way that is not defined. An example of this is a comparison of a Boolean value to a Date type.

Error ID: BC36621

To correct this error

  • Make sure that the values on each side of the Equals operator can be converted to a common data type. Some options for accomplishing this are:

    • Use the CType function to convert one or more of the values to a specific type.

    • Use the Convert class or conversion methods to convert one or more of the values to a common, immutable type.

    • Convert the values to strings by using the ToString method.

See Also

Concepts

Introduction to LINQ in Visual Basic

Reference

CType Function

Join Clause (Visual Basic)

Group Join Clause (Visual Basic)

Other Resources

Type Conversions in Visual Basic

LINQ in Visual Basic