sql - VB.net MySQL Update all items in the listview -


how update items in listview @ same time in database? have code don't know what's wrong, updates first row in listview. want update items shown in listview

 each row listviewitem in listview3.items             con.open()             cmd.connection = con             cmd.commandtext = "update pawn set status = 'redeemed' pawn_id = '" & listview3.items(0).text & "'"             dr = cmd.executereader               con.close()          next 

you sending 0th element of listview in parameter.

here error:

cmd.commandtext = "update pawn set status = 'redeemed' pawn_id = '" & listview3.items(0).text & "'" 

there should be:

cmd.commandtext = "update pawn set status = 'redeemed' pawn_id = '" & row.text & "'" 

if send listview3.items(0).text in statement - updates same row.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -