[英]@Parameter1 is not a parameter for procedure
ALTER PROCEDURE [dbo].[NST_InsertTblGenLedDet]
@GHDHeader int,
@Gldtype text,
@GldAccount text,
@GldDate DateTime,
@GldVoucherType int,
@GldDebit float=null,
@GldCredit float= null,
@GldDtaLine int= null
AS
DECLARE @ERR INT
BEGIN TRANSACTION
Insert into [TblGenLedDet]
(GHDHeader,Gldtype,GldAccount,GldDate, GldVoucherType, GldDebit,GldCredit,GldDtaLine)
values (@GHDHeader,@Gldtype,@GldAccount,@GldDate, @GldVoucherType, @GldDebit,@GldCredit,@GldDtaLine)
SET @ERR = @@Error
IF @ERR = 0
BEGIN
COMMIT TRANSACTION
END
ELSE
BEGIN
ROLLBACK TRANSACTION
RETURN @ERR
END
I am getting this error again and again though i have specified the parameter name as @GldCredit it shows Parameter name as Parameter1 我一次又一次地收到此错误,虽然我已将参数名称指定为@GldCredit,但它将参数名称显示为Parameter1
In your code, you initialize gldCredit
, but then update gldDebit
. 在您的代码中,您初始化
gldCredit
,但随后更新gldDebit
。 Your gldCredit
parameter never has any of its members set, and thus, has its ParaameterName
defautled to "@Paremeter1"
. 您的
gldCredit
参数永远不会设置任何成员,因此将其ParaameterName
解除为"@Paremeter1"
。
It looks like you copy/pasted the gldDebit
code for setting up your parameter, but forgot to update all the references in the new block of code to point to gldCredit
. 看起来您复制/粘贴了用于设置参数的
gldDebit
代码,但忘记更新新代码块中的所有引用以指向gldCredit
。
Sharing for future readers - 分享给未来的读者 -
This error is also thrown when the @ParameterName
in your C#
code is different than @Parameter_Name
in stored-procedures
. 当
C#
代码中的@Parameter_Name
与stored-procedures
的@ParameterName
不同时,也会抛出此错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.