私はこのような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