records deleted from database when uploading files -


when try upload multiple pictures database code works fine , pictures show in gallery, when try modify picture in database, , modify 1 picture deletes rest of pictures database. recordset isnt deleted , rest of information stays same, 5+ places have pictures data gets deleted. here code far..

message.text = "please wait"     pics.visible = false     'wherepics stored     dim savepath string = server.mappath("/cgi-bin/properties/")     dim tfn0 string = ""     dim tfn1 string = ""     'dims filenames variables     dim img0 string = pic0.filename     dim img1 string = pic1.filename     'this set of paths check     'this check redundencies in database no dublicate file names occur     dim ptc0 string = savepath + img0     dim ptc1 string = savepath + img1      dim url0 string = ""     dim url1 string = ""     dim counter integer = 2     if (system.io.file.exists(ptc0))         while (system.io.file.exists(ptc0))             tfn0 = counter.tostring = img0             ptc0 = savepath + tfn0             counter = counter + 1         end while     elseif (system.io.file.exists(ptc1))         while (system.io.file.exists(ptc1))             tfn1 = counter.tostring = img1             ptc1 = savepath + tfn1             counter = counter + 1         end while     end if     dim sp0 string = savepath + img0     dim sp1 string = savepath + img1     if not pic0.filename = nothing         pic0.saveas(sp0)         img0 = pic0.filename         url0 += "pic_main"         url1 += img0     end if     if not pic1.filename = nothing         if pic0.filename = nothing             pic1.saveas(sp1)             img1 = pic0.filename             url0 += "pic_one"             url1 += img1         else             pic1.saveas(sp1)             img1 = pic0.filename             url0 += ", pic_one"             url1 += ", " & img1         end if      end if      dim datanames() string = {url0}     ', "pic_six", "pic_seven", "pic_eight", "pic_nine"     dim datavalues() string = {url1}     ', file6, file7, file8, file9     db.updatecommand(datanames, datavalues, "property", "property_id = " & request.querystring("id")) ', true)     response.redirect("finished.aspx") 

i have found solution looking @ of file upload controls, since nothing in them reference fields had figured out while ago, got busy , never found time post answer. in database , delete in , replace blank space. changed code bit users chooses slot in want update, carry on qstring instead of having update of them @ once


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -