Thursday, November 20, 2008

Variable '' hides a variable in an enclosing block

Problem: A variable enclosed in a block has the same name as another local variable.

Error ID: BC30616

To correct this error:

  1. Rename the variable in the enclosed block so that it is not the same as any other local variables.
  2. A common cause for this error is the use of Catch e As Exception inside an event handler. If this is the case, name the Catch block variable ex rather than e.
  3. Another common source of this error is an attempt to access a local variable declared within a Try block in a separate Catch block. To correct this, declare the variable outside the Try...Catch...Finally structure.
Source:
http://msdn.microsoft.com/en-us/library/wtk40des(VS.80).aspx

No comments: