mysql - Error when updating value at SQL database -
i want updating data @ database sql vb.net. i'm facing problem. more specific, data updated when barcode textbox same @ datagridview column. here's code
private sub nharga_textchanged(byval sender system.object, byval e system.eventargs) handles nharga.textchanged if cbarcode.text <> "" dim isi integer isi = me.datagridview1.currentrow.index datagridview1.rows.item(isi) if .cells(0).value = cbarcode.text try dim cmd new mysqlcommand("update transaksi_sementara set jumlah = jumlah + 1 barcode = '" & cbarcode.text & "'", dbkon) dbreader.close() if cmd.executenonquery = 1 call bersih() call tampil() end if catch ex exception msgbox(ex.message, msgboxstyle.critical) end try else try dim cmd new mysqlcommand("insert transaksi_sementara values('" & cbarcode.text & "','" & cnamabarang.text & "','1','" & nharga.text & "','" & nharga.text & "')", dbkon) dbreader.close() if cmd.executenonquery = 1 call bersih() call tampil() end if catch ex exception msgbox(ex.message, msgboxstyle.critical) end try end if end end if end sub
Comments
Post a Comment