my update button:
'mysql code dim con mysqlconnection = new mysqlconnection("server=shhh;user id=root;password=shhhh;database=member") dim reader mysqldatareader 'insert image dim mstream new system.io.memorystream() pic.image.save(mstream, system.drawing.imaging.imageformat.png) dim arrimage() byte = mstream.getbuffer() mstream.close() try con.open() dim query string dim command mysqlcommand query = "update doxdb set aliases='" & aliases.text & "',ualiases='" & ualiases.text & "', fullname='" & fullname.text & "', address='" & address.text & "', address2='" & address2.text & "', address3='" & address3.text & "', relative1='" & relative1.text & "', relative2='" & relative2.text & "', relative3='" & relative3.text & "', relative4='" & relative4.text & "', phone='" & phone.text & "', ipaddress='" & ipaddress.text & "', email='" & email.text & "', email2='" & email2.text & "', facebook='" & facebook.text & "', instagram='" & instagram.text & "', dod='" & dod.text & "', dob='" & dob.text & "', twitter='" & twitter.text & "', skype='" & skype.text & "', notes='" & notes.text & "', pic = @pic aliases='" & aliases.text & "'" command = new mysqlcommand(query, con) command.parameters.addwithvalue("@pic", arrimage) reader = command.executereader messagebox.show("data saved") con.close() catch ex exception messagebox.show(ex.message) con.dispose() end try
my chose image button:
ofdimage .initialdirectory = "c:" .filter = "only picture jpg/jpeg/png extension|*.jpg;*.jpeg;*.png" .filename = nothing end if ofdimage.showdialog = windows.forms.dialogresult.ok pic.backgroundimagelayout = imagelayout.stretch pic.image = image.fromfile(ofdimage.filename) pic.tag = ofdimage.filename else pic.tag = "" end if
the exception throwing me:
************** exception text ************** system.runtime.interopservices.externalexception (0x80004005): generic error occurred in gdi+. @ system.drawing.image.save(stream stream, imagecodecinfo encoder, encoderparameters encoderparams) @ system.drawing.image.save(stream stream, imageformat format) @ widox.doxdb.nyx_button4_click_2(object sender, eventargs e) @ system.windows.forms.control.onclick(eventargs e) @ system.windows.forms.control.wmmouseup(message& m, mousebuttons button, int32 clicks) @ system.windows.forms.control.wndproc(message& m) @ system.windows.forms.control.controlnativewindow.onmessage(message& m) @ system.windows.forms.control.controlnativewindow.wndproc(message& m) @ system.windows.forms.nativewindow.callback(intptr hwnd, int32 msg, intptr wparam, intptr lparam)
and trying do:
http://i.stack.imgur.com/jsugr.png
once image uploaded not let update , keeps throwing error. don't know do, if need anymore information or code please let me know, trying done asap, tried provide info possible make old questions, thank you!
Comments
Post a Comment