本文介绍了如何传递参数IExecuteResult的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好, 我想通过linq使用Iexecute执行存储过程结果,如何传递参数 我的存储过程在下面 创建 proc [dbo]。[GetEmpByName] ( @ Ename nvarchar ( 50 ) ) as begin 选择 * 来自 Emp 其中​​ Ename = @ Ename end 我的功能是 [Function(Name =GetEmpByName,IsComposable = false)] public ISingleResult < Myems > getCustomerAll(string name) { IExecuteResult objResult = this.ExecuteMethodCall(this,(MethodInfo)(MethodInfo.GetCurrentMethod())); ISingleResult < Myems > objresults =(ISingleResult < Myems > )objResult.ReturnValue; 返回objresults; } 你可以指导我如何传递参数解决方案 尝试使用 [Function(Name =GetEmpByName,IsComposable = false)] public ISingleResult < Myems > getCustomerAll([parameter( DBType =Varchar(50))] string Ename) { IExecuteResult objResult = this.ExecuteMethodCall(this,(MethodInfo)(MethodInfo.GetCurrentMethod())); ISingleResult& lt; Myems& gt; objresults =(ISingleResult& lt; Myems& gt;)objResult.ReturnValue; 返回objresults; } < / pre > 希望这会有所帮助...... Hi All, I want to execute stored procedure through linq using Iexecute results,how can i pass parameterMy stored procedure is below create proc [dbo].[GetEmpByName](@Ename nvarchar(50))asbeginselect * from Emp where Ename=@Enameendmy function is[Function(Name = "GetEmpByName", IsComposable = false)] public ISingleResult<Myems> getCustomerAll(string name) { IExecuteResult objResult = this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod())); ISingleResult<Myems> objresults = (ISingleResult<Myems>)objResult.ReturnValue; return objresults; }can u guide me how pass parameter 解决方案 Try using [Function(Name = "GetEmpByName", IsComposable = false)] public ISingleResult<Myems> getCustomerAll([parameter(DBType="Varchar(50)")] string Ename) { IExecuteResult objResult = this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod())); ISingleResult&lt;Myems&gt; objresults = (ISingleResult&lt;Myems&gt;)objResult.ReturnValue; return objresults; }</pre>Hope this helps... 这篇关于如何传递参数IExecuteResult的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-22 03:47