我有一个看起来像这样的 SP。试图在 C# 程序中从 SP 中捕获选择值
CREATE PROC sp_Dosomething
@Prefix nvarchar(2),
@Result nvarchar(8) output
AS
BEGIN
DECLARE @LastValue int
DECLARE @FirstValue int
insert into Table1(name,number) values('ssss','123')
@LastValue= @@Identity
insert into Table2(name,number) values('ssss','123')
@FirstValue = @@Identity
Select @LastValue as 'Table1Id', @FirstValue as 'Table2Id'
RETURN True
END
C#
Response.Redirect("~/Pag1.aspx?Accountid=" + Table1Id+"&ClaimId=" + Table2Id,false);
问题:
Accountid = Table1Id = @LastValue This is good
ClaimId= Table2Id = @FirstValue This is always zero