Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
An XML literal declaration is used in an expression in a location that is ambiguous to the Visual Basic compiler. That is, the Visual Basic compiler cannot determine whether the less-than character (<) is intended as a comparative operator or the start of an XML literal. The following code provides an example:
[Visual Basic]
' Generates an error.
Dim queryResult = From element In elements _
Where <sample>Value</sample> = "Value" _
Select element
Error ID: BC31198
To correct this error
Enclose the XML literal declaration in parentheses, as shown in the following example:
Dim queryResult = From element In elements _ Where (<sample> Value</sample>) = "Value" _ Select element
Modify your code to refer to an existing XML literal, as shown in the following example:
Dim queryResult = From element In elements _ Where e.<sample>.Value = "Value" _ Select element