C# function to execute the stored procedure having multiple outputs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nischalinn
    New Member
    • Mar 2014
    • 16

    C# function to execute the stored procedure having multiple outputs

    how can I write a function which can execute stored procedure with any number of inputs and multiple output parameters.

    I want to write a sql helper class for this.
    my stored procedure,
    Code:
    CREATE PROCEDURE GetOrderDetails
    @OrderID int,
    @OrderLbl varchar(3),
    @OrderName nvarchar(40) OUTPUT,
    @UnitPrice money OUTPUT,
    AS
    	SELECT @OrderName = OrderName, 
    	@UnitPrice = UnitPrice,
    	FROM Orders 
    	WHERE OrderID = @OrderID and OrderMark = @OrderLbl

    how can I write a C# class to execute such type of procedures and how to implement such classes.

    I tried writing a function but do not have enough idea to start with.
Working...