0

我有一个存储过程

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

我想@intGnrtdid 在使用 LINQ 时获取 int 变量的值。

4

1 回答 1

0

请参阅 Scott Guthrie 关于 Linq to SQL 的优秀博客系列。第 6 部分介绍调用存储过程。ref当从代码调用强类型存储过程时,out 参数将简单地由参数表示。

于 2013-01-21T10:34:46.470 回答