Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

SQl Exception 80131904 Cursorfetch: The number of variables declared in the INTO list must match that of selected columns

$
0
0

Dear Experts,

in my application following procedures updates my table in one of database but in another database same table it is giving SQl Exception 80131904 error and till last week it was working fine in both databases, can you guide how look into this problem

    CursorAdapter cursor1 = new CursorAdapter();
            cursor1.SelectCmd = @"select a.debit_gl,maingl.name as DBname,a.srl,a.qty, a.uom, a.rate, a.amount, 
                    a.sold_qty,a.Remark,a.packingamt, a.bed_amt, a.ecess_amt, a.hecess_amt,a.aed_amt,a.lstcd,a.lstamt,
                    a.finyear, a.podtl_ui, a.ui,  a.purchase_ui, a.grndtl_ui, a.item_ui, item.name,a.bed_rt,a.ecess_rt,a.hecess_rt,
                    a.tds_rt,tds_amt,a.tcs_rt,a.tcs_amt,a.SaleTax_rt, 
                    Convert(nvarchar,item.itemgroupid)+'-'+Convert(nvarchar,item.id) as itemno,a.postvatcharges,a.first_stage_qty, 
                    a.first_stage_rate,a.first_stage_invno,a.first_stage_invdt,a.first_stage_mainslui,e.name suppliername,
                    Convert( nvarchar,e.sl_code)+'-'+Convert(nvarchar,e.gl_code) supplierCode,
                    convert(Nvarchar, d.doc_gl)+'-'+convert(Nvarchar, d.doc_no)+convert(Nvarchar,c.srl) grn_key,
                    a.ex_chptrno,a.supplierRG23DENo,a.prevatamount  
                    from purchaseitems a 
                    left join item on a.item_ui=item.ui  
                    Left join maingl on maingl.gl_code= a.debit_gl  
                    Left Join grnitem c on a.grndtl_ui=c.ui   
                    Left join grn d on c.grn_ui=d.ui  
                    Left join mainsl e on a.first_stage_mainslui=e.ui
                    where a.finyear=@finyear
                    order by purchase_ui, srl";

            cursor1.SendUpdate = true;
            cursor1.updatableFieldList =
                @"debit_gl,srl,qty,uom,rate,amount,Remark,packingamt,bed_amt,
                ecess_amt,hecess_amt,aed_amt,lstcd,lstamt,finyear,podtl_ui,ui,purchase_ui,grndtl_ui,item_ui,
                bed_rt,ecess_rt,hecess_rt,tds_rt,tds_amt,tcs_rt,tcs_amt,SaleTax_rt,postvatcharges,
                first_stage_qty,first_stage_rate,first_stage_invno,
                first_stage_invdt, first_stage_mainslui,ex_chptrno,supplierRG23DENo,prevatamount";
            cursor1.SqlTable = "purchaseitems";
            cursor1.keyfields = "ui";
            cursor1.beforecursorfill += new CursorAdapter.beforecursorfillEventHandler(cursor1_beforecursorfill);
            cursor1.BuildAdapter(ds, ref o1);

SqlDataAdapter adppurchaseitems = (SqlDataAdapter)o1;
returnValue=adppurchaseitems.Update(ds.Tables["purchaseitems"]);

following SQL text appears in adapterpurchaseitems.update

debit_gl=@debit_gl,srl=@srl,qty=@qty,uom=@uom,rate=@rate,amount=@amount,Remark=@Remark,
packingamt=@packingamt,bed_amt=@bed_amt,ecess_amt=@ecess_amt,hecess_amt=@hecess_amt,aed_amt=@aed_amt,lstcd=@lstcd,
lstamt=@lstamt,finyear=@finyear,podtl_ui=@podtl_ui,ui=@ui,purchase_ui=@purchase_ui,grndtl_ui=@grndtl_ui,
item_ui=@item_ui,bed_rt=@bed_rt,ecess_rt=@ecess_rt,hecess_rt=@hecess_rt,tds_rt=@tds_rt,tds_amt=@tds_amt,
tcs_rt=@tcs_rt,tcs_amt=@tcs_amt,SaleTax_rt=@SaleTax_rt,postvatcharges=@postvatcharges,first_stage_qty=@first_stage_qty,
first_stage_rate=@first_stage_rate,first_stage_invno=@first_stage_invno,first_stage_invdt=@first_stage_invdt,
first_stage_mainslui=@first_stage_mainslui,ex_chptrno=@ex_chptrno,supplierRG23DENo=@supplierRG23DENo,
prevatamount=@prevatamount where (ui=@O_ui);

Select debit_gl,srl,qty,uom,rate,amount,Remark,packingamt,bed_amt,
                ecess_amt,hecess_amt,aed_amt,lstcd,lstamt,finyear,podtl_ui,ui,purchase_ui,grndtl_ui,item_ui,
                bed_rt,ecess_rt,hecess_rt,tds_rt,tds_amt,tcs_rt,tcs_amt,SaleTax_rt,postvatcharges,
                first_stage_qty,first_stage_rate,first_stage_invno,
                first_stage_invdt, first_stage_mainslui,ex_chptrno,supplierRG23DENo,prevatamount from purchaseitems where (ui=@ui)


Viewing all articles
Browse latest Browse all 2535

Trending Articles