.net - A column named 'STATUS' already belongs to this DataTable -


in sql query, fine.. , running okay.. once go process to.. error come out "a column named 'status' belongs datatable " here sql query

dim sql string = " select distinct led.idx idx, corpcode, unittypecode, upperformationcode, formationcode, led.unitcode unitcode,led.storecode storecode, led.sectionno sectionno, led.partno partno, "             sql &= " led.batchno batchno, unititemcategorycode, ledgerdate, entitlement, holding, surplus, shortage, costholding, costentitlement, initialstock, employqty, fightqty, itemage1, itemage2, itemage3,"             sql &= " itemage4, led.bah_berek, led.jenis_berek, jptd_no, lastupdate, led.itemtypecode itemtypecode, led.tooltypecode tooltypecode, led.pakaibhgcode, led.pakaicode, itemnidx, led.createid createid, "             sql &= " led.updateid updateid, led.createdate createdate, led.updatedate updatedate, "             sql &= " userid, rankcode, serviceno, username, designationcode, password, "             sql &= " 'oper' groupcode,5 acessid, 0 status "             sql &= " (ledger led) "             sql &= " left join nuser   on nuser.userid = led.updateid   (1=1)   "             if condation <> ""                 sql += condation             end if             sql &= " union select distinct led.idx idx, corpcode, unittypecode, upperformationcode, formationcode, led.unitcode unitcode, led.storecode storecode, led.sectionno sectionno, led.partno partno, "             sql &= " led.batchno batchno, unititemcategorycode, ledgerdate, entitlement, holding, surplus, shortage, costholding, costentitlement, initialstock, employqty, fightqty, itemage1, itemage2, itemage3,"             sql &= " itemage4, led.bah_berek, led.jenis_berek, jptd_no, lastupdate, led.itemtypecode itemtypecode, led.tooltypecode tooltypecode, led.pakaibhgcode, led.pakaicode, itemnidx, led.createid createid, "             sql &= " led.updateid updateid, led.createdate createdate, led.updatedate updatedate,"             sql &= " '','','','','','','oper',5 , status "             sql &= " ledger_history led (1=1) "             if condation <> ""                 sql += condation             end if 

for process.i dont know need fix.. can me solve proble. here process code:

dim dt new datatable     dim cond string = ""     if cboformasi.selectedvalue.tostring.length > 0         cond &= " , led.formationcode=" & parsestringtosql(cboformasi.selectedvalue)     end if     if cbounit.selectedvalue.tostring.length > 0         cond &= " , led.unitcode=" & parsestringtosql(cbounit.selectedvalue)     end if      try         dt = objlejer.exporttall(cond)         if dt isnot nothing andalso dt.rows.count > 0             dt.columns.add("batchdate")             dt.columns.add("nsnno")             dt.columns.add("mfgno")             dt.columns.add("itemcategorycode")             dt.columns.add("materialtypecode")             dt.columns.add("image")             dt.columns.add("siapsiaga")             dt.columns.add("measurecode")             dt.columns.add("item_image")             dt.columns.add("mis_tag")             dt.columns.add("mis_name")             dt.columns.add("sfs_tag")             dt.columns.add("tsnstsb")             dt.columns.add("flag")             dt.columns.add("cost")             dt.columns.add("itemname")             dt.columns.add("oldpartno")             dt.columns.add("isdel")             dt.columns.add("status")             dt.acceptchanges() 

hope can me solve problem


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -