title: How to use stored Procedure with output parameters while using Data Access layer with ASP.NET
body: <p>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.</p>
  
  <p>But the Stored Procedure has output parameter, How to use it now ?</p>
  
  <p><strong>Stored Procedure</strong></p>
  
  <pre><code>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></pre>
  
  <p>Code for Using <strong>Function</strong> :</p>
  
  <pre><code>LeaveClass obj = new LeaveClass();
  bytes[] b;
  b= obj.Function_ShowLeaveDetails(1);
  </code></pre>
  
  <p>It is showing <strong>Error</strong> -- </p>
  
  <blockquote>
    <p>Function overload is
    Function_ShowLeaveDetails(int,System.Data.Objects)</p>
  </blockquote>
  
  <p>Also, This one is not working :</p>
  
  <pre><code>LeaveClass obj = new LeaveClass();
      bytes[] b;
      obj.Function_ShowLeaveDetails(1,b);
  </code></pre>
  
  <p>How do I retrieve the value of output parameter ?? </p>