title: How to update database using listview in vb.net
body: <p>I am using a Listview to update database. It works perfect for the first row in listview. How can I update my database if there is more then one row in listview?</p>
  
  <p>I have 6 columns in listview.</p>
  
  <p>Listview Property changed to:</p>
  
  <pre><code>Hideselection = false
  Multiselect = false
  Fullrowselect = true
  </code></pre>
  
  <p>My Code:</p>
  
  <pre><code>For y = 0 To ListView1.Items.Count - 1
  If (objcon.con.State = ConnectionState.Closed) Then objcon.con.Open()
  cmd1 = New OleDbCommand("UPDATE Customers SET " &amp; _
  "fup = #" &amp; ListView1.Items(0).SubItems(5).Text &amp; "#" &amp; _
  "WHERE policy_no = '" &amp; ListView1.Items(0).SubItems(1).Text &amp; "'", objcon.con)
  cmd1.ExecuteNonQuery()
  objcon.con.Close()
  Next
  </code></pre>