当我向 gridview 添加一些列时,出现上述错误。但 ActualService 与我在数据库中的 Column 相同。请帮我解决这个错误。
我的代码:
<Columns>
<asp:TemplateField HeaderText="PMRMName" SortExpression="PMRMName">
<ItemTemplate>
<asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl='<%# "db_PmuKpi_CF_AllPMs.aspx?PMRMID="+ Eval("PMRMID") + "&PMRMName =" + Eval("PMRMName")%>' Text='<%# Eval("PMRMName","{0}")%>' Target="_blank"></asp:HyperLink>
<asp:Label ID="lblRM" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="BudgetRevenue" HeaderText="BudgetRevenue" SortExpression="BudgetRevenue" />
<asp:BoundField DataField="BudgetCOGS" HeaderText="BudgetCOGS" SortExpression="BudgetCOGS" />
<asp:BoundField DataField="BudgetService" HeaderText="BudgetService" SortExpression="BudgetService" />
<asp:BoundField DataField="BudgetCashFlow" HeaderText="BudgetCashFlow" SortExpression="BudgetCashFlow" />
<asp:BoundField DataField="ActualRevenue" HeaderText="ActualRevenue" SortExpression="ActualRevenue" />
<asp:BoundField DataField="ActualCOGS" HeaderText="ActualCOGS" SortExpression="ActualCOGS" />
<asp:BoundField DataField="ActualService " HeaderText="ActualService " SortExpression="ActualService " />
<asp:BoundField DataField="ActualCashFlow " HeaderText="ActualCashFlow " SortExpression="ActualCashFlow " />
</Columns>
我使用以下 SQL:
select PMRMID,PMRMName,BudgetRevenue,BudgetCOGS,BudgetService,BudgetCashFlow, ActualRevenue, ActualCOGS, ActualService,ActualCashFlow from [fn_pmukpi_CurrentMonthCF_AllRMs] ---------my function –