Hello all! I have hit a small bump in my development of a program I am working on. Basically what I need to happen is this; for each item in the listview it executes a SQL query to input values into a database. In this case it pulls the quantity from the listview for each entry, it then (by means of a SQL query) adds the quantity of the entry in the listview to the existing quantity of that entry in the database. Here is the pseudocode I am working on to do this. Make corrections and suggestions as needed as this isn't yet solved.
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
Dim lvi As ListViewItem
For Each lvi In ListView1.Items
Call Back2Inv()
Next
End Sub
Private Sub Back2Inv()
ds = New DataSet
da = New MySqlDataAdapter("update inventory set qty='" & ListView1.SelectedItems(0).SubItems(1).Text & "'where id='" & ListView1.SelectedItems(0).SubItems(0).Text & "'", mysqlconn)
da.Fill(ds, "inventory")
End Sub