I have the following sniplet of a stored procedure in SQL Server
Create PROCEDURE [dbo].[usp_Genpwd]
@pass varchar(8) OUTPUT
AS
BEGIN
In my c# code, how do I get the output from the stored proc throught the data context?
var pwd = db.usp_Genpwd(..)
Intellisense says to put ref string pass in the paranthesis but when I do the following:
var pwd = db.usp_Genpwd(ref string pass);
I get a invalid arguments error
I am not sure what goes in the paranthesis as I am outputting a value from the stored proc.
A
refparameter means a reference to a variable or field.In order to call a function that takes a
refparameter, you need to pass a variable or field with therefkeyword: