0

I have a stored Procedure as

ALTER PROCEDURE  [dbo].[customers_iu] (@intId as int, @strName as nvarchar(100), @strSname as nvarchar(100),@intInsupdt as int = 0,   @intGnrtdid as int OUTPUT)
AS
BEGIN
SET NOCOUNT ON;
if @intInsupdt = 1
begin
insert into dbo.customers (cust_Name, cust_Sname, cust_Tinno) values (@strName, @strSname,@strTinno) 
set @intGnrtdid = (select ident_Current('dbo.customers'))
end
else if @intInsupdt = 0
begin
update dbo.customers set cust_Name = @strName, cust_Tinno = @strTinno where cust_Id = @intId ;
set @intGnrtdid = @intId    
end
END

I want to get @intGnrtdid value to a int Variable in using LINQ.

I4V
  • 34,891
  • 6
  • 67
  • 79

1 Answers1

0

See Scott Guthrie's excellent blog series on Linq to SQL. Part 6 covers calling stored procedures. An out parameter would simply be represented by a ref parameter when calling your strongly typed stored procedure from code.

Daniel Kelley
  • 7,579
  • 6
  • 42
  • 50