我有一个存储过程
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
我希望在使用LINQ时将@intGnrtdid
值赋予int变量。
答案 0 :(得分:0)
请参阅Scott Guthrie关于Linq to SQL的优秀博客系列。 Part 6涵盖了调用存储过程。从代码调用强类型存储过程时,out参数将仅由ref
参数表示。