0

I have a Stored procedure in SQL Server 2008 and I am using it from my ASP.NET application. I using a Data Access Layer and i created a Function Import for my Stored Procedure.

But the Stored Procedure has output parameter, How to use it now ?

Stored Procedure

ALTER PROCEDURE [dbo].[SPShowLeaveDetails]
(
@LID INT ,
@leave_details VARBINARY(MAX) OUTPUT
)
AS
BEGIN
SELECT @leave_details= leave_details from LeaveTable where LID = @LID
return @leave_details
END

Code for Using Function :

LeaveClass obj = new LeaveClass();
bytes[] b;
b= obj.Function_ShowLeaveDetails(1);

It is showing Error --

Function overload is Function_ShowLeaveDetails(int,System.Data.Objects)

Also, This one is not working :

LeaveClass obj = new LeaveClass();
    bytes[] b;
    obj.Function_ShowLeaveDetails(1,b);

How do I retrieve the value of output parameter ??

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
akshaykumar6
  • 2,147
  • 4
  • 18
  • 31

1 Answers1

0

Sorry for that, Are you using EF ? like here

You can also find details on that blog

Community
  • 1
  • 1
GeorgesD
  • 1,072
  • 5
  • 7
  • Dude they are using `SQlConnection` String. I am not using it. Tell me anything using data entity model with ASP.NET – akshaykumar6 Dec 18 '12 at 09:45
  • they have nothing to say above byte[] . can you help me with that? I'm not getting the exact solution needed for the types like byte[] – akshaykumar6 Dec 18 '12 at 10:26
  • Maybe you can change your SP, it can return a string and then you parse it to have a byte[]. http://stackoverflow.com/questions/5916116/interpreting-byte-in-stored-procedure – GeorgesD Dec 18 '12 at 10:36