Range variable <variable> hides a variable in an enclosing block, a previously defined range variable, or an implicitly declared variable in a query expression

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

A range variable name specified in a Select, From, Aggregate, or Let clause duplicates the name of a range variable already specified previously in the query, or the name of a variable that is implicitly declared by the query, such as a field name or the name of an aggregate function.

Error ID: BC36633

To correct this error

  • Ensure that all range variables in a particular query scope have unique names. You can enclose a query in parentheses to ensure that nested queries have a unique scope.

Introduction to LINQ in Visual Basic
From Clause
Let Clause
Aggregate Clause
Select Clause

Show: