Ajay Saini

Ajay Saini

  • 1.5k
  • 183
  • 24.2k

Retrieve values of multiple out parameters from Linq to SQL

Oct 15 2015 1:17 AM
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 :
Hide Copy Code
Create Procedure [dbo].[tblMgmt_test_sp]
@numAmt_Actual int=0 output,
@return varchar(20)=null output
AS
.....
....
 
And my Controller action is as -
 
Hide Copy Code
int? numAmt_Actual = 1;
string returnVal = "";
var strResult = datacontext.tblMgmt_test_sp(ref numAmt_Actual ,ref returnVal);
 
Not sure which datatype to hold the result of datacontext.tblMgmt_test_sp and how?

Can you please help me regarding this issue?