本文介绍了我不明白错误是什么.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

error =

名为'frmMultiPlanReport'的局部变量不能在此范围内声明,因为它会给'frmMultiPlanReport'赋予不同的含义,'frmMultiPlanReport'已在'父级或当前'范围内使用表示别的东西



code =

frmMultiPlanReport frmMultiPlanReport = this;

frmMultiPlanReport.SqlQry = str5;

error=
A local variable named 'frmMultiPlanReport' cannot be declared in this scope because it would give a different meaning to 'frmMultiPlanReport', which is already used in a 'parent or current' scope to denote something else

code=
frmMultiPlanReport frmMultiPlanReport = this;
frmMultiPlanReport.SqlQry = str5;

推荐答案

public class MyClass
    {
    public void MyMethod()
        {
        MyClass MyClass = new MyClass();
        while (true)
            {
            MyClass MyClass = new MyClass();
            }
        }
    }

并且在MyClass变量的第二个定义上报告错误。只需更改它的名称,你就没事了。

And the error is being reported on the second definition of the MyClass variable. Just change it's name, and you'll be fine.



这篇关于我不明白错误是什么.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-15 20:26