“名称'prevfundedList'在当前contex中不存在”

时间:2019-11-24 14:26:58

标签: c#

我无法解决此问题,并且似乎无法弄清楚我做错了什么。 这是我代码的其他部分。

else {
      string prevFundedList = firstFundList;

      foreach (object[] item in tempRsList)
      {
           if(prevfundedList != fundedList && item[12].ToString() == "PinYear")
           {
                oExcelApp.Cells[rowNum, 1] = "SFY " + year.ToString() + " Planning List - Bypass Systems";
                oExcelApp.Cells[rowNum, 1].Font.Bold = true;
                rowNum = rowNum + 1;
           }
           prevFundedList = item[12].ToString();
      }
} // end of else

错误说

  

“名称'prevfundedList'在当前contex中不存在”

1 个答案:

答案 0 :(得分:0)

c#中的变量名区分大小写。
您的声明是prevFundedList,但在if语句中将其声明为prevfundedList