本文介绍了在foreach循环中获取错误不支持的operater的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是



foreach(dsUnits.Tables [0]中的DataRow dr。选择(UnitType ='Expense'|| UnitTpye ='Both' ))

{



UnitLevelReport = GetUnitNonPersonnelSummary(Convert.ToInt32(dr [UnitID]),out tempRptName);

CurrentPDFReport = UnitLevelReport;

if(count == 0)

{

MergedPDFReport = MergePDF2(PrevPDFReport,CurrentPDFReport,dr [UnitID]。ToString());

PrevPDFReport = MergedPDFReport;

}

else

{

MergedPDFReport = MergePDF2(PrevPDFReport,CurrentPDFReport,dr [UnitID]。ToString());

PrevPDFReport = MergedPDFReport;

}

count ++;

}





如何解决它...

解决方案

my code is

foreach (DataRow dr in dsUnits.Tables[0].Select("UnitType='Expense' || UnitTpye ='Both'"))
{

UnitLevelReport = GetUnitNonPersonnelSummary(Convert.ToInt32(dr["UnitID"]), out tempRptName);
CurrentPDFReport = UnitLevelReport;
if (count == 0)
{
MergedPDFReport = MergePDF2(PrevPDFReport, CurrentPDFReport, dr["UnitID"].ToString());
PrevPDFReport = MergedPDFReport;
}
else
{
MergedPDFReport = MergePDF2(PrevPDFReport, CurrentPDFReport, dr["UnitID"].ToString());
PrevPDFReport = MergedPDFReport;
}
count++;
}


How to solve it...

解决方案


这篇关于在foreach循环中获取错误不支持的operater的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:58