question

jeff020590 avatar image
jeff020590 asked

Procedure or function 'RecurEntInsert2' has too many arguments specified

Is anyone can help with this error.... Here's my STORED PROC.>>>>>>>>>>>>>>>> ALTER PROCEDURE [dbo].[RecurEntInsert2] @EntNo nvarchar(max), @WorkId int, @EntDt nvarchar(50), @DateFr nvarchar(50), @DateTo nvarchar(50), @Particulars nvarchar(50), @DrCr nvarchar(50) AS ----------------------------------RECURENT HDR INSERT-------------------------------------- --if @EntNo not in (Select EntNo from RecurEntHdr where WorkId = @WorkId) begin --Select 'd2' declare @DocRef nvarchar(max) set @DocRef = (Select distinct CASE WHEN (Select WrkrClsId from Workers WHERE WorkId = @WorkId) = 351 then 'C' ELSE 'A' END FROM Workers) declare @RecurEntId int EXEC dbo.MaxIdGet 'RecurEntHdr','RecurEntId',@RecurEntId output select @RecurEntId INSERT INTO RecurEntHdr ( RecurEntId, WorkId, EntNo, EntDt, DocRef, DateFr, DateTo, Particulars ) VALUES ( @RecurEntId, @WorkId, @EntNo, @EntDt, @DocRef, @DateFr, @DateTo, @Particulars ) update SysPar set IncrRecurEntNo = (Select IncrRecurEntNo + 1 from SysPar where ParId = 1) ----------------------------------RECURENT DTL INSERT-------------------------------------- declare @RecurEntDtlId int EXEC dbo.MaxIdGet 'RecurEntDtl','RecurEntDtlId',@RecurEntDtlId output INSERT INTO RecurEntDtl ( RecurEntDtlId, RecurEntId, DrCr ) VALUES ( @RecurEntDtlId, @RecurEntId, @DrCr ) end RETURN AND HERE'S MY CODE IN VB.NET>>>>>>>>>>>>>>>>>>>>>>>>>> Public Overridable Function RecurEntInsert() As Integer Dim cmd As IDbCommand Dim strSQL As String ' Validate() strSQL = "RecurEntInsert2" cmd = DataLayer.CreateCommand(strSQL, mstrConnectString) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(DataLayer.CreateParameter("@EntNo", DbType.String, RecEntryNo)) cmd.Parameters.Add(DataLayer.CreateParameter("@WorkId", DbType.String, WorkId)) cmd.Parameters.Add(DataLayer.CreateParameter("@EntDt", DbType.String, dtRecDt)) cmd.Parameters.Add(DataLayer.CreateParameter("@DateFr", DbType.Date, dtFrom)) cmd.Parameters.Add(DataLayer.CreateParameter("@DateTo", DbType.Date, dtTo)) cmd.Parameters.Add(DataLayer.CreateParameter("@Particulars", DbType.String, Particulars)) cmd.Parameters.Add(DataLayer.CreateParameter("@DrCr", DbType.String, DrCr)) cmd.Parameters.Add(DataLayer.CreateParameter("@TranCd", DbType.String, TranCd)) cmd.Parameters.Add(DataLayer.CreateParameter("@TranDescr", DbType.String, TranDesc)) cmd.Parameters.Add(DataLayer.CreateParameter("@TranAmt", DbType.Decimal, TranAmt)) cmd.Parameters.Add(DataLayer.CreateParameter("@REmarks", DbType.String, Remarks)) cmd.Parameters.Add(DataLayer.CreateParameter("@Tax", DbType.Boolean, Tax)) Return DataLayer.ExecuteSQL(cmd, True) End Function The error is (Procedure or function 'RecurEntInsert2' has too many arguments specified) Thanks and Regards.
stored-procedures
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Usman Butt avatar image
Usman Butt answered
Your stored procedure expects only these 7 parameters (**@EntNo @WorkId @EntDt @DateFr @DateTo @Particulars @DrCr**). But you are supplying these surplus parameters (**@TranCd @TranDescr @TranAmt" @REmarks @Tax**). This is why you are prompted with the error.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jeff020590 avatar image jeff020590 commented ·
Thanks for the info.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.