如何在Linq to SQL中检索存储过程的多个输出参数的值 [英] How to retrieve values of multiple output parameters of Stored Procedure in Linq to SQL

查看:72
本文介绍了如何在Linq to SQL中检索存储过程的多个输出参数的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用MVC 4和Linq to SQL类并使用存储过程进行交易。

我有简单的存储过程,有两个不同的输出参数数据类型。我正在努力检索存储过程返回的值。



我的SP如:

Hi,
I am using MVC 4 with Linq to SQL class and using stored procedure for my transaction.
I have simple stored procedure having two output parameters with different data types. I am struggling to retrieve the values of both return by stored procedure.

My SP like as :

Create Procedure [dbo].[tblMgmt_test_sp] 
@numAmt_Actual int=0 output, 
@return varchar(20)=null output  
AS  
.....
....





我的控制器操作是 -



And my Controller action is as -

int? numAmt_Actual = 1;
string returnVal = "";

var strResult = datacontext.tblMgmt_test_sp(ref numAmt_Actual ,ref returnVal);





不确定保存<$ c $结果的数据类型c> datacontext.tblMgmt_test_sp 以及如何?



关于这个问题,请帮帮我吗?



Not sure which datatype to hold the result of datacontext.tblMgmt_test_sp and how?

Can you please help me regarding this issue?

推荐答案

http://stackoverflow.com / questions / 6999441 / sql-server-2008-stored-procedure-with-multiple-output-parameters [ ^ ]


上面的查询是固定在我的最后没有修改我的代码中的任何部分。
The above query is fixed at my end without modifying any part in my code.


这篇关于如何在Linq to SQL中检索存储过程的多个输出参数的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆