0

Procedure or function P_UpdatePurchaseInv_test has too many arguments specified.

    ALTER PROC [dbo].[P_DeleteForUpdatePurInvDet]
    --Purchase Invoice Details       12 pic(13pic active)
      --@purid   int ,        
    --@purinvid  varchar(255),      
    @purinvdt  date,      
    @invno   varchar(255),       
    @invdt   date,       
    @nrr   varchar(200),       
    @partyIDpur  int,      
    @invtypidpur int,      
    @tottaxblamt decimal(18, 2),      
    @nettaxamt  decimal(18, 2),      
    @invamt   decimal(18, 2),      
    @totalcgst  decimal(18, 2),      
    @totalsgst  decimal(18, 2),      
    @totaligst  decimal(18, 2),      
    -------------------------------------      
    --Purchase Invoice Sub Details --------16pic (18pic) active
    @slno   int,        
    @ItemIDpur  int,     
    @ItemhsnID  int,      
    @PDQty   int,        
    @PDMRP   decimal(18, 2),        
    @PDRate   decimal(18, 2),         
    @PDdis   decimal(18, 2),         
@pdcgst   decimal(18, 2),         
@cgstamt  decimal(18, 2),         
@pdsgst   decimal(18, 2),         
@sgstamt  decimal(18, 2),         
@pdigst   decimal(18, 2),         
@igstamt  decimal(18, 2),         
@TaxableAmt  decimal(18, 2),         
@totaltaxamt decimal(18, 2),         
@PDAmount  decimal(18, 2),   
--@purdate date,     
-------STOCK----------- UPDATE------------        
@MRP decimal(7, 2),          
@prate decimal(7, 2),
@purinvid varchar(50),------------------------- Pass 
@itemid  int  --------------------------------- Pass
  as

  begin
  delete from TBL_pur_invdet where purinvid=@purinvid
  end

  begin
  insert into TBL_pur_invdet(purinvid,slno,ItemIDpur,PDQty,PDMRP,PDRate,PDdis,pdcgst,cgstamt,pdsgst,sgstamt,pdigst,igstamt,TaxableAmt,totaltaxamt,PDAmount,itemhsnid,purdate)          
  values(@purinvid,@slno,@ItemIDpur,@PDQty,@PDMRP,@PDRate,@PDdis,@pdcgst,@cgstamt,@pdsgst,@sgstamt,@pdigst,@igstamt,@TaxableAmt,@totaltaxamt,@PDAmount,@ItemhsnID,@invdt)          
  end

  begin
  update tbl_item set  MRP=@MRP,prate=@prate where itemid=@itemid    
  end

  begin
  update tbl_pur_inv set purinvid=@purinvid,purinvdt=@purinvdt,invno=@invno,invdt=@invdt,nrr=@nrr,partyIDpur=@partyIDpur,invtypidpur=@invtypidpur,tottaxblamt=@tottaxblamt,nettaxamt=@nettaxamt,invamt=@invamt,totalcgst=@totalcgst,totalsgst=@totalsgst,totaligst=@totaligst
  where purinvid=@purinvid 
  end

VB.net -----------------------------

Public Function EditPurchaseinv() As DataSet ' Edit Purchase Invoice ------------------------------------------------------------------
            Dim db As New DBAccess
            db.AddParameter("@purinvid", purinvid)
            db.AddParameter("@purinvdt", purinvdt)
            db.AddParameter("@invno", invno)
            db.AddParameter("@invdt", invdt)
            db.AddParameter("@nrr", nrr)
            db.AddParameter("@partyIDpur", partyIDpur)
            db.AddParameter("@invtypidpur", invtypidpur)
            db.AddParameter("@tottaxblamt", tottaxblamt)
            db.AddParameter("@nettaxamt", nettaxamt)
            db.AddParameter("@invamt", invamt)
            db.AddParameter("@totalcgst", totalcgst)
            db.AddParameter("@totalsgst", totalsgst)
            db.AddParameter("@totaligst", totaligst)

            '------------------------------------------

            'db.AddParameter("@purinvid", purinvid)
            db.AddParameter("@slno", slno)
            db.AddParameter("@ItemIDpur", ItemIDpur)
            db.AddParameter("@ItemhsnID", ItemhsnID)
            db.AddParameter("@PDQty", PDQty)
            db.AddParameter("@PDMRP", PDMRP)
            db.AddParameter("@PDRate", PDRate)
            db.AddParameter("@PDdis", PDdis)
            db.AddParameter("@pdcgst", pdcgst)
            db.AddParameter("@cgstamt", cgstamt)
            db.AddParameter("@pdsgst", pdsgst)
            db.AddParameter("@sgstamt", sgstamt)
            db.AddParameter("@pdigst", pdigst)
            db.AddParameter("@igstamt", igstamt)
            db.AddParameter("@TaxableAmt", TaxableAmt)
            db.AddParameter("@totaltaxamt", totaltaxamt)
            db.AddParameter("@PDAmount", PDAmount)
            db.AddParameter("@purdate", purdate)
            '---------------STOCK UPDATE----------------------
            db.AddParameter("@itemid", itmid)
            db.AddParameter("@MRP", MRP)
            db.AddParameter("@prate", prate)
            'db.AddParameter("@QTY", QTY)

            Return db.ExecuteDataSet("P_UpdatePurchaseInv_test") 'P_UpdatePurchaseInv_test       P_UpdatePurchaseInv
        End Function
2
Contributors
1
Reply
18
Views
1 Week
Discussion Span
Last Post by hericles
0

That error generally comes from having an incorrect number of parameters in you SQL queries or, in some other way, introducing an error involving the parameters.
Pay close attention to the table schema and double check all of your mentioned parameters are correct.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.