1
正當我向gridview添加一些列時,出現了上述錯誤。但ActualService與我在數據庫中的列相同。請幫我解決這個錯誤。在所選數據源中找不到名稱爲「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>
我使用follwing SQL:
select PMRMID,PMRMName,BudgetRevenue,BudgetCOGS,BudgetService,BudgetCashFlow, ActualRevenue, ActualCOGS, ActualService,ActualCashFlow from [fn_pmukpi_CurrentMonthCF_AllRMs] ---------my function –
你可以發佈你的sql嗎? – bUKaneer
iam從我的功能採取它。 –
從[fn_pmukpi_CurrentMonthCF_AllRMs]中選擇PMRMID,PMRMName,BudgetRevenue,BudgetCOGS,BudgetService,BudgetCashFlow,ActualRevenue,ActualCOGS,ActualService,ActualCashFlow --------- my function –