asp.net - Attempted to divide by zero error on page load -


every time load page, gives out error saying have attempted divide zero. after checking it, found out happens on our production link because have published on our local pc , works fine. below query using on page:

select distinct *  ( select c.containerid         ,wldw.wafernumber "wafer"         ,wldd.wipdatavalue "item qty"         ,iqty.wipdatavalue "integrator qty"         ,nd.wipdatavalue "net die"         ,tr.wipdatavalue "total rejects"         ,vi.wipdatavalue "visual inspection"         ,tpedispo.wipdatavalue "tpe disposition"         ,pa.wipdatavalue "pre align"         ,pa.wipdatavalue "post visual"         , decode(nvl(iqty.wipdatavalue,0),0,0, round((nvl(nd.wipdatavalue,0) / nvl(iqty.wipdatavalue,0))  * 100,2)) "yield"         ,comments.wipdatavalue "comments"         ,oper.wipdatavalue "operator"         ,pcwi.wipdatavalue "inspector"         ,engr.wipdatavalue "engineer"         ,wldw.waferstatus "status"         ,wl.wiplotid wiplothistoryid         ,wl.wiptrackinggroupkeyid         ,wl.specid         ,wldw.wafersequence         ,1 withdrilldown         , gq.wipdatavalue ws_grossqty         , gd.wipdatavalue ws_gooddie         , tq.wipdatavalue ws_testedqty         , wr.wipdatavalue ws_totalrejects         , vi.wipdatavalue ws_visualinspection         , td.wipdatavalue ws_tpedisposition         , wc.wipdatavalue ws_comments         , oqa.wipdatavalue oqarejecttype         , wldd.wipdatanamename   container c   join a_wiplot wl on c.containerid = wl.containerid   join a_wiplotdetails wld on wl.wiplotid = wld.wiplotid   join a_wiplotdetailswafers wldw on wld.wiplotdetailsid = wldw.wiplotdetailsid   join a_wiplotdetailsdata wldd on wld.wiplotdetailsid = wldd.wiplotdetailsid , wldd.waferscribenumber = wldw.waferscribenumber   left join a_wiplotdetailsdata nd on wld.wiplotdetailsid = nd.wiplotdetailsid , nd.waferscribenumber = wldw.waferscribenumber , nd.wipdatanamename = 'ws_net die'   left join a_wiplotdetailsdata iqty on wld.wiplotdetailsid = iqty.wiplotdetailsid , iqty.waferscribenumber = wldw.waferscribenumber , iqty.wipdatanamename = 'ws_integrator qty'   left join a_wiplotdetailsdata tr on wld.wiplotdetailsid = tr.wiplotdetailsid , tr.waferscribenumber = wldw.waferscribenumber , tr.wipdatanamename = 'ws_total rejects'   left join a_wiplotdetailsdata vi on wld.wiplotdetailsid = vi.wiplotdetailsid , vi.waferscribenumber = wldw.waferscribenumber , vi.wipdatanamename = 'ws_visual inspection'   left join a_wiplotdetailsdata tpedispo on wld.wiplotdetailsid = tpedispo.wiplotdetailsid , tpedispo.waferscribenumber = wldw.waferscribenumber , tpedispo.wipdatanamename = 'ws_tpe disposition'   left join a_wiplotdetailsdata pa on wld.wiplotdetailsid = pa.wiplotdetailsid , pa.waferscribenumber = wldw.waferscribenumber , pa.wipdatanamename = 'ws_pre align'   left join a_wiplotdetailsdata pv on wld.wiplotdetailsid = pv.wiplotdetailsid , pv.waferscribenumber = wldw.waferscribenumber , pv.wipdatanamename = 'ws_post visual'   left join a_wiplotdetailsdata comments on wld.wiplotdetailsid = comments.wiplotdetailsid , comments.waferscribenumber = wldw.waferscribenumber , comments.wipdatanamename = 'ws_comments'   left join a_wiplotdetailsdata oper on wld.wiplotdetailsid = oper.wiplotdetailsid , oper.waferscribenumber = wldw.waferscribenumber , oper.wipdatanamename = 'ws_operator'   left join a_wiplotdetailsdata engr on wld.wiplotdetailsid = engr.wiplotdetailsid , engr.waferscribenumber = wldw.waferscribenumber , engr.wipdatanamename = 'ws_engineer'   left join a_wiplotdetailsdata pcwi on wld.wiplotdetailsid = pcwi.wiplotdetailsid , pcwi.waferscribenumber = wldw.waferscribenumber , pcwi.wipdatanamename = 'ws_inspector'   left join a_wiplotdetailsdata gq on wld.wiplotdetailsid = gq.wiplotdetailsid , gq.waferscribenumber = wldw.waferscribenumber , gq.wipdatanamename = 'ws_gross qty'   left join a_wiplotdetailsdata gd on wld.wiplotdetailsid = gd.wiplotdetailsid , gd.waferscribenumber = wldw.waferscribenumber , gd.wipdatanamename = 'ws_good die'   left join a_wiplotdetailsdata tq on wld.wiplotdetailsid = tq.wiplotdetailsid , tq.waferscribenumber = wldw.waferscribenumber , tq.wipdatanamename = 'ws_tested qty/sample size'   left join a_wiplotdetailsdata wr on wld.wiplotdetailsid = wr.wiplotdetailsid , wr.waferscribenumber = wldw.waferscribenumber , wr.wipdatanamename = 'ws_total rejects'   left join a_wiplotdetailsdata vi on wld.wiplotdetailsid = vi.wiplotdetailsid , vi.waferscribenumber = wldw.waferscribenumber , vi.wipdatanamename = 'ws_visual inspection'   left join a_wiplotdetailsdata td on wld.wiplotdetailsid = td.wiplotdetailsid , td.waferscribenumber = wldw.waferscribenumber , td.wipdatanamename = 'ws_tpe disposition'   left join a_wiplotdetailsdata wc on wld.wiplotdetailsid = wc.wiplotdetailsid , wc.waferscribenumber = wldw.waferscribenumber , wc.wipdatanamename = 'ws_comments'   left join a_wiplotdetailsdata oqa on wld.wiplotdetailsid = oqa.wiplotdetailsid , oqa.waferscribenumber = wldw.waferscribenumber , oqa.wipdatanamename = 'for oqa_reject type'  c.containername = :lotid , wl.wiptrackinggroupkeyid = :id , wldd.iswaferdata = 1 , wldd.wipdatanamename in ('ws_item qty', 'ws_gross qty')  union select c.containerid         ,wldw.wafernumber "wafer"         ,wldd.wipdatavalue "item qty"         ,iqty.wipdatavalue "integrator qty"         ,nd.wipdatavalue "net die"         ,tr.wipdatavalue "total rejects"         ,vi.wipdatavalue "visual inspection"         ,tpedispo.wipdatavalue "tpe disposition"         ,pa.wipdatavalue "pre align"         ,pa.wipdatavalue "post visual"         , decode(nvl(iqty.wipdatavalue,0),0,0, round((nvl(nd.wipdatavalue,0) / nvl(iqty.wipdatavalue,0))  * 100,2)) "yield"         ,comments.wipdatavalue "comments"         ,oper.wipdatavalue "operator"         ,pcwi.wipdatavalue "inspector"         ,engr.wipdatavalue "engineer"         ,wldw.waferstatus "status"         ,wl.wiplothistoryid         ,wl.wiptrackinggroupkeyid         ,wl.specid         ,wldw.wafersequence         ,1 withdrilldown         , gq.wipdatavalue ws_grossqty         , gd.wipdatavalue ws_gooddie         , tq.wipdatavalue ws_testedqty         , wr.wipdatavalue ws_totalrejects         , vi.wipdatavalue ws_visualinspection         , td.wipdatavalue ws_tpedisposition         , wc.wipdatavalue ws_comments         , oqa.wipdatavalue oqarejecttype         , wldd.wipdatanamename   container c   join a_wiplothistory wl on c.containerid = wl.containerid   join a_wiplotdetailshistory wld on wl.wiplothistoryid = wld.wiplothistoryid   join a_wiplotdetailswafershistory wldw on wld.wiplotdetailshistoryid = wldw.wiplotdetailshistoryid   join a_wiplotdetailsdatahistory wldd on wld.wiplotdetailshistoryid = wldd.wiplotdetailshistoryid , wldd.waferscribenumber = wldw.waferscribenumber   left join a_wiplotdetailsdatahistory nd on wld.wiplotdetailshistoryid = nd.wiplotdetailshistoryid , nd.waferscribenumber = wldw.waferscribenumber , nd.wipdatanamename = 'ws_net die'   left join a_wiplotdetailsdatahistory iqty on wld.wiplotdetailshistoryid = iqty.wiplotdetailshistoryid , iqty.waferscribenumber = wldw.waferscribenumber , iqty.wipdatanamename = 'ws_integrator qty'   left join a_wiplotdetailsdatahistory tr on wld.wiplotdetailshistoryid = tr.wiplotdetailshistoryid , tr.waferscribenumber = wldw.waferscribenumber , tr.wipdatanamename = 'ws_total rejects'   left join a_wiplotdetailsdatahistory vi on wld.wiplotdetailshistoryid = vi.wiplotdetailshistoryid , vi.waferscribenumber = wldw.waferscribenumber , vi.wipdatanamename = 'ws_visual inspection'   left join a_wiplotdetailsdatahistory tpedispo on wld.wiplotdetailshistoryid = tpedispo.wiplotdetailshistoryid , tpedispo.waferscribenumber = wldw.waferscribenumber , tpedispo.wipdatanamename = 'ws_tpe disposition'   left join a_wiplotdetailsdatahistory pa on wld.wiplotdetailshistoryid = pa.wiplotdetailshistoryid , pa.waferscribenumber = wldw.waferscribenumber , pa.wipdatanamename = 'ws_pre align'   left join a_wiplotdetailsdatahistory pv on wld.wiplotdetailshistoryid = pv.wiplotdetailshistoryid , pv.waferscribenumber = wldw.waferscribenumber , pv.wipdatanamename = 'ws_post visual'   left join a_wiplotdetailsdatahistory comments on wld.wiplotdetailshistoryid = comments.wiplotdetailshistoryid , comments.waferscribenumber = wldw.waferscribenumber , comments.wipdatanamename = 'ws_comments'   left join a_wiplotdetailsdatahistory oper on wld.wiplotdetailshistoryid = oper.wiplotdetailshistoryid , oper.waferscribenumber = wldw.waferscribenumber , oper.wipdatanamename = 'ws_operator'   left join a_wiplotdetailsdatahistory engr on wld.wiplotdetailshistoryid = engr.wiplotdetailshistoryid , engr.waferscribenumber = wldw.waferscribenumber , engr.wipdatanamename = 'ws_engineer'   left join a_wiplotdetailsdatahistory pcwi on wld.wiplotdetailshistoryid = pcwi.wiplotdetailshistoryid , pcwi.waferscribenumber = wldw.waferscribenumber , pcwi.wipdatanamename = 'ws_inspector'   left join a_wiplotdetailsdatahistory gq on wld.wiplotdetailshistoryid = gq.wiplotdetailshistoryid , gq.waferscribenumber = wldw.waferscribenumber , gq.wipdatanamename = 'ws_gross qty'   left join a_wiplotdetailsdatahistory gd on wld.wiplotdetailshistoryid = gd.wiplotdetailshistoryid , gd.waferscribenumber = wldw.waferscribenumber , gd.wipdatanamename = 'ws_good die'   left join a_wiplotdetailsdatahistory tq on wld.wiplotdetailshistoryid = tq.wiplotdetailshistoryid , tq.waferscribenumber = wldw.waferscribenumber , tq.wipdatanamename = 'ws_tested qty/sample size'   left join a_wiplotdetailsdatahistory wr on wld.wiplotdetailshistoryid = wr.wiplotdetailshistoryid , wr.waferscribenumber = wldw.waferscribenumber , wr.wipdatanamename = 'ws_total rejects'   left join a_wiplotdetailsdatahistory vi on wld.wiplotdetailshistoryid = vi.wiplotdetailshistoryid , vi.waferscribenumber = wldw.waferscribenumber , vi.wipdatanamename = 'ws_visual inspection'   left join a_wiplotdetailsdatahistory td on wld.wiplotdetailshistoryid = td.wiplotdetailshistoryid , td.waferscribenumber = wldw.waferscribenumber , td.wipdatanamename = 'ws_tpe disposition'   left join a_wiplotdetailsdatahistory wc on wld.wiplotdetailshistoryid = wc.wiplotdetailshistoryid , wc.waferscribenumber = wldw.waferscribenumber , wc.wipdatanamename = 'ws_comments'   left join a_wiplotdetailsdatahistory oqa on wld.wiplotdetailshistoryid = oqa.wiplotdetailshistoryid , oqa.waferscribenumber = wldw.waferscribenumber , oqa.wipdatanamename = 'for oqa_reject type'  c.containername = :lotid , wl.wiptrackinggroupkeyid = :id , wldd.iswaferdata = 1 , wldd.wipdatanamename in ('ws_item qty', 'ws_gross qty') ) wd order wd."wafer", wd.wafersequence 

and also, code behind:

using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using ext.net;  namespace camstarreportportal.webforms.maximdatacollection.wafersortmaxcim {     public partial class maxcimwstestersummary : system.web.ui.page     {          static string wipkey;          protected void page_load(object sender, eventargs e)         {             if (!page.ispostback)             {                 txtlot.text = request.querystring["lotid"].tostring();                 txtspec.text = request.querystring["specname"].tostring();                 txtwipkey.text = request.querystring["id"].tostring();                  wipkey = session["id"].tostring();                  uwgdatacollection.datasourceid = whdsdatacollection.id;                 uwgdatacollection.databind();                 uwgdatacollection.expandall();                 customizecolumns(txtspec.text.substring(0, 4));                 expirepagecache();             }              if (ddlinsertion.items.findbyvalue("%") != null)             {                 //do nothing             }             else             {                 ddlinsertion.items.insert(0, new system.web.ui.webcontrols.listitem("all", "%"));             }         }          public void customizecolumns(string opcode)         {             if (uwgdatacollection.bands.count > 1)             {                 switch (opcode)                 {                     case "8628":                     case "8337":                                         case "8622":                         {                             this.uwgdatacollection.bands[1].columns[3].hidden = true;//sample size                             this.uwgdatacollection.bands[1].columns[4].hidden = false;//tester summary                             this.uwgdatacollection.bands[1].columns[5].hidden = false;//igs qty                             this.uwgdatacollection.bands[1].columns[6].hidden = false;//total rejects                             this.uwgdatacollection.bands[1].columns[7].hidden = false;//yield                             this.uwgdatacollection.bands[1].columns[8].hidden = false;//variance                             this.uwgdatacollection.bands[1].columns[9].hidden = true;//qa test result                             this.uwgdatacollection.bands[1].columns[10].hidden = false;//probemark inspection                              this.uwgdatacollection.bands[1].columns[11].hidden = false;//remarks                             this.uwgdatacollection.bands[1].columns[12].hidden = true;//remarks2                             this.uwgdatacollection.bands[1].columns[13].hidden = false;//operator                             this.uwgdatacollection.bands[1].columns[14].hidden = false;//engineer                             this.uwgdatacollection.bands[1].columns[15].hidden = false;//bin failure                             this.uwgdatacollection.bands[1].columns[16].hidden = false;//mismatch disposition                             this.uwgdatacollection.bands[1].columns[17].hidden = true;//yield disposition                             this.uwgdatacollection.bands[1].columns[18].hidden = true;//reject disposition                             this.uwgdatacollection.bands[1].columns[19].hidden = false;//waferstatus                             this.uwgdatacollection.bands[1].columns[20].hidden = true;//elect. rejects @ 8628                             this.uwgdatacollection.bands[1].columns[21].hidden = false;//adjustment qty                              if (opcode == "8622")                             {                                 this.uwgdatacollection.bands[1].columns[16].hidden = true;//mismatch disposition                                 this.uwgdatacollection.bands[1].columns[18].hidden = false;//reject disposition                             }                             break;                         }                     case "7628":                     case "7337":                     case "7629":                     case "8537":                         {                             this.uwgdatacollection.bands[1].columns[3].hidden = false;//sample size                             this.uwgdatacollection.bands[1].columns[4].hidden = false;//tester summary                             this.uwgdatacollection.bands[1].columns[5].hidden = false;//igs qty                             this.uwgdatacollection.bands[1].columns[6].hidden = false;//total rejects                             this.uwgdatacollection.bands[1].columns[7].hidden = false;//yield                             this.uwgdatacollection.bands[1].columns[8].hidden = false;//variance                             this.uwgdatacollection.bands[1].columns[9].hidden = false;//qa test result                             this.uwgdatacollection.bands[1].columns[10].hidden = true;//probemark inspection                              this.uwgdatacollection.bands[1].columns[11].hidden = false;//remarks                             this.uwgdatacollection.bands[1].columns[12].hidden = true;//remarks2                             this.uwgdatacollection.bands[1].columns[13].hidden = false;//operator                             this.uwgdatacollection.bands[1].columns[14].hidden = false;//engineer                             this.uwgdatacollection.bands[1].columns[15].hidden = false;//bin failure                             this.uwgdatacollection.bands[1].columns[16].hidden = true;//mismatch disposition                             this.uwgdatacollection.bands[1].columns[17].hidden = false;//yield disposition                             this.uwgdatacollection.bands[1].columns[18].hidden = false;//reject disposition                             this.uwgdatacollection.bands[1].columns[19].hidden = false;//waferstatus                             this.uwgdatacollection.bands[1].columns[20].hidden = false;//elect. rejects @ 8628                             this.uwgdatacollection.bands[1].columns[21].hidden = false;//adjustment qty                             if (opcode == "8537")                             {                                 this.uwgdatacollection.bands[1].columns[15].hidden = true;//bin failure                                 this.uwgdatacollection.bands[1].columns[16].hidden = false;//mismatch disposition                                 this.uwgdatacollection.bands[1].columns[10].hidden = true;//probemark inspection                                  this.uwgdatacollection.bands[1].columns[9].hidden = true;//qa test result                                 this.uwgdatacollection.bands[1].columns[18].hidden = true;//reject disposition                             }                             if (opcode == "7628")                             {                                 this.uwgdatacollection.bands[1].columns[17].hidden = true;//yield disposition                             }                              break;                         }                     case "6103":                         {                             this.uwgdatacollection.bands[1].columns[1].hidden = true;//integrator qty                             this.uwgdatacollection.bands[1].columns[2].hidden = true;//net die                             this.uwgdatacollection.bands[1].columns[3].hidden = true;//total rejects                             this.uwgdatacollection.bands[1].columns[4].hidden = true;//visual inspection                             this.uwgdatacollection.bands[1].columns[5].hidden = true;//tpe dispo                             this.uwgdatacollection.bands[1].columns[6].hidden = true;//pre align                             this.uwgdatacollection.bands[1].columns[7].hidden = true;//post visual                             this.uwgdatacollection.bands[1].columns[8].hidden = true;//yield                             this.uwgdatacollection.bands[1].columns[9].hidden = true;//comment                             this.uwgdatacollection.bands[1].columns[10].hidden = true;//operator                             this.uwgdatacollection.bands[1].columns[11].hidden = true;//inspector                             this.uwgdatacollection.bands[1].columns[12].hidden = true;//engineer                                 this.uwgdatacollection.bands[1].columns[13].hidden = true;//status                             this.uwgdatacollection.bands[1].columns[14].hidden = false;//ws gross qty                             this.uwgdatacollection.bands[1].columns[15].hidden = false;//ws die                             this.uwgdatacollection.bands[1].columns[16].hidden = false;//ws tested qty                             this.uwgdatacollection.bands[1].columns[17].hidden = false;//ws total rejects                             this.uwgdatacollection.bands[1].columns[18].hidden = false;//ws visual inspection                             this.uwgdatacollection.bands[1].columns[19].hidden = false;//ws tpe dispo                             this.uwgdatacollection.bands[1].columns[20].hidden = false;//ws comments                             this.uwgdatacollection.bands[1].columns[21].hidden = false;//oq reject type                              break;                         }                     default:                         {                             this.uwgdatacollection.bands[1].columns[14].hidden = true;//ws gross qty                             this.uwgdatacollection.bands[1].columns[15].hidden = true;//ws die                             this.uwgdatacollection.bands[1].columns[16].hidden = true;//ws tested qty                             this.uwgdatacollection.bands[1].columns[17].hidden = true;//ws total rejects                             this.uwgdatacollection.bands[1].columns[18].hidden = true;//ws visual inspection                             this.uwgdatacollection.bands[1].columns[19].hidden = true;//ws tpe dispo                             this.uwgdatacollection.bands[1].columns[20].hidden = true;//ws comments                             this.uwgdatacollection.bands[1].columns[21].hidden = true;//oq reject type                                 break;                         }                 };              }         }          private void expirepagecache()         {             response.cache.setcacheability(httpcacheability.nocache);             response.cache.setexpires(datetime.now - new timespan(1, 0, 0));             response.cache.setlastmodified(datetime.now);             response.cache.setallowresponseinbrowserhistory(false);         }          protected void ddlinsertion_selectedindexchanged(object sender, eventargs e)         {             string value = ddlinsertion.selecteditem.value.tostring();              if (ddlinsertion.selecteditem.value.tostring() == "all")             {                 uwgdatacollection.datasourceid = whdsdatacollection.id;                 uwgdatacollection.databind();                 uwgdatacollection.expandall();                 customizecolumns(txtspec.text.substring(0, 4));                 expirepagecache();             }             else             {                 uwgdatacollection.datasourceid = whdsdatacollectionapb.id;                 uwgdatacollection.databind();                 uwgdatacollection.expandall();                 customizecolumns(txtspec.text.substring(0, 4));                 expirepagecache();             }            }     } } 

we made sure there division 0 error handled in query , not have computations on code behind. helping everyone.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -