我试图了解这段代码的工作原理,但这是我第一次看到这段代码。存储的过程被调用一次还是两次,每个数据绑定一次?
在第一次分析时,我看到它显示result.ReturnValue
的位置,这似乎是存储的过程的结果,但不确定。
<Global.System.Data.Linq.Mapping.FunctionAttribute(Name:="dbo.sp_VhosCogs_Results")>
Public Function sp_VhosCogs_Results(<Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="ProspectID", DbType:="NVarChar(50)")> ByVal prospectID As String, <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="SetPoint", DbType:="NVarChar(10)")> ByVal setPoint As String, <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="Ancilliary_bundled", DbType:="Bit")> ByVal ancilliary_bundled As System.Nullable(Of Boolean), <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="LineLoss_Rate", DbType:="Bit")> ByVal lineLoss_Rate As System.Nullable(Of Boolean), <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="ProdType", DbType:="NVarChar(50)")> ByVal prodType As String) As ISingleResult(Of sp_VhosCogs_ResultsResult)
Dim result As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod,MethodInfo), prospectID, setPoint, ancilliary_bundled, lineLoss_Rate, prodType)
Return CType(result.ReturnValue,ISingleResult(Of sp_VhosCogs_ResultsResult))
End Function
Dim query = dbProspectView.sp_VhosCogs_Results(Request.QueryString("ContractID"),
GridView.DataSource = query
GridView1.DataBind()
GridView2.DataSource = query
GridView2.DataBind()