when i run this Stored-Procedures from vb.net it run but not work properly.
i want
1st ---- delete the all data against the 'Saleinvid'
2nd ---- insert data against the 'Saleinvid'
But it delete all data and insert only single data(one) which is entry at last in list view in vb.net application
please help me....
What I have tried:
ALTER PROC P_UpdateSaleInv
@saleinvid nvarchar(255) ,
@slno int ,
@ItemIDsale int ,
@SDQty int ,
@SDMRP decimal(18, 2) ,
@SDRate decimal(18, 2) ,
@SDdis decimal(18, 2) ,
@Sdcgst decimal(18, 2) ,
@Scgstamt decimal(18, 2) ,
@Sdsgst decimal(18, 2) ,
@Ssgstamt decimal(18, 2) ,
@Sdigst decimal(18, 2) ,
@Sigstamt decimal(18, 2) ,
@STaxableAmt decimal(18, 2) ,
@Stotaltaxamt decimal(18, 2) ,
@SDAmount decimal(18, 2) ,
@S_type varchar(2) ,
@S_ItemHSNid int,
@SaleInvdt date
as
BEGIN
begin
delete from TBL_sale_invdet where saleinvid=@saleinvid
end
begin
insert into TBL_sale_invdet(saleinvid,slno,ItemIDsale,SDQty,SDMRP,SDRate,SDdis,Sdcgst,Scgstamt,Sdsgst,Ssgstamt,Sdigst,Sigstamt,STaxableAmt,Stotaltaxamt,SDAmount,S_type,S_ItemHSNid,SaleInvdt)
values(@saleinvid,@slno,@ItemIDsale,@SDQty,@SDMRP,@SDRate,@SDdis,@Sdcgst,@Scgstamt,@Sdsgst,@Ssgstamt,@Sdigst,@Sigstamt,@STaxableAmt,@Stotaltaxamt,@SDAmount,@S_type,@S_ItemHSNid,@SaleInvdt)
end
end