Name '<name>' is either not declared or not in the current scope

A LINQ query refers to a programming element, but the compiler cannot find an element that has that exact name.

Error ID: BC36610

To correct this error

  1. Check the spelling of the name in the referring statement. Visual Basic is case-insensitive, but any other variation in the spelling constitutes a different name. Note that the underscore (_) is part of the name and therefore part of the spelling.

  2. Verify that the programming element is in scope. If the referring statement is outside the region declaring the programming element, you might have to qualify the element name. For more information, see Scope in Visual Basic.

  3. Ensure that you have the member access operator (.) between an object and its member. For example, if you have a TextBox control named TextBox1, to access its Text property you should type TextBox1.Text. If instead you type TextBox1Text, you have created a different name.

See Also

Concepts

Introduction to LINQ in Visual Basic

Visual Basic Naming Conventions

Other Resources

References to Declared Elements