当我向gridview添加一些列时,我遇到了上述错误。但ActualService与我在数据库中的列相同。请帮我解决这个错误。
我的代码:
<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 –
答案 0 :(得分:2)
您在BoundField(DataField)的列名中的“ActualService”和“ActualCashFlow”之后有一个空格。