Need advice for ASP.NET Grid[checkbox] -
i created web app. , now, i'm having problem it. used grid checkbox. have scenario when user select data save in database, tick checkbox in grid. now, problem when save data. takes 3-5mins save. there way optimize it? here's code
each ogriditem in dgobj.items dim ocheck checkbox = ogriditem.findcontrol("chkselect1") if ocheck.checked = true try if apptype.text = 124 webctrl.strcommand = "exec spfilterunliquidation '" & apptype.text & "', '" & getgriditem("appid").text & "', '" & dgobj.datakeys(ogriditem.itemindex) & "', '" & getcompanyid & "' set dateformat mdy exec spupdateunliquidate '" & getgriditem("appid").text & "', '" & dgobj.datakeys(ogriditem.itemindex) & "', " & getgriditem("diffamnt").text & ", '" & getcompanyid & "' " else webctrl.strcommand = "exec spfilterliquidation '" & apptype.text & "', '" & getgriditem("appid").text & "', '" & dgobj.datakeys(ogriditem.itemindex) & "', '" & getcompanyid & "' " end if catch exp exception webctrl.setmessage(exp) goto rollback end try webctrl.strcommand = "select appid _temp appid = '" & getgriditem("appid").text & "' " if webctrl.dscount() > 0 webctrl.strcommand = "delete _temp liquidator = '" & txtliqid.text & "' " webctrl.strcommand = "insert _temp select * app_ocae appid = '" & getgriditem("appid").text & "' " else webctrl.strcommand = "insert _temp select * app_ocae appid = '" & getgriditem("appid").text & "' " end if webctrl.strcommand = "select appid _temp1 appid = '" & getgriditem("appid").text & "' , lineid = '" & dgobj.datakeys(ogriditem.itemindex) & "' " if webctrl.dscount() > 0 webctrl.strcommand = "insert _temp1 select * app_cae1 appid = '" & getgriditem("appid").text & "' , lineid = '" & dgobj.datakeys(ogriditem.itemindex) & "' " else webctrl.strcommand = "insert _temp1 select * app_cae1 appid = '" & getgriditem("appid").text & "' , lineid = '" & dgobj.datakeys(ogriditem.itemindex) & "' " end if octr += 1 oappid(octr) = getgriditem("appid").text oappno(octr) = getgriditem("appno").text end if next
in code, check first row checked , include database. if have 100 records, loop row in grid. think that's bottleneck. :(
Comments
Post a Comment