DBML 设计器中的代码
[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.uspCalculateRiskMatrix")]
public int uspCalculateRiskMatrix([global::System.Data.Linq.Mapping.ParameterAttribute(Name="CashPrice", DbType="Float")] System.Nullable cashPrice, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="InputAPH", DbType="Int")] System.Nullable inputAPH, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Bushels", DbType="Int")] System.Nullable bushels, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PercentageCover", DbType="Float")] System.Nullable percentageCover, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="BasicEstimate", DbType="Float")] System.Nullable basicEstimate, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CallStrike", DbType="Float")] System.Nullable callStrike, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CallBu", DbType="Int")] System.Nullable callBu, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="CallPremium", DbType="Float")] System.Nullable callPremium, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PutStrike", DbType="Float")] System.Nullable putStrike, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PutBu", DbType="Int")] System.Nullable putBu, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PutPremium", DbType="Float")] System.Nullable putPremium, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="TotalAcres", DbType="Float")] System.Nullable totalAcres, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="AvgPrice", DbType="Float")] System.Nullable avgPrice, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="PerAcreProductionCost", DbType="Float")] System.Nullable perAcreProductionCost, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="SpringPrice", DbType="Float")] System.Nullable springPrice)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), cashPrice, inputAPH, bushels, percentageCover, basicEstimate, callStrike, callBu, callPremium, putStrike, putBu, putPremium, totalAcres, avgPrice, perAcreProductionCost, springPrice);
return ((int)(result.ReturnValue));
}
==================================================== ========================
我将 SP 与 gridview 绑定的代码
var a = from risk in HRM_dc.uspCalculateRiskMatrix(CashPrice, InputAPH, Bushels, PercentageCover, BasicEstimate, CallStrike, CallBu, CallPremium,
PutStrike, PutBu, PutPremium, TotalAcres, AvgPrice, PerAcreProductionCost, SpringPrice)
select risk;
GridView gvRisk = new GridView();
gvRisk.DataSource = a;
gvRisk.DataBind();
错误:错误 2 找不到源类型“int”的查询模式的实现。未找到“选择”。
请帮助快速TIA