title: Inserting listview items individually into database as new entries in c#
body: <p>I want each individual item inserted into database as a new entry. Right now, I am only able to insert all items into the database as a single entry.
  I am trying to add 3 book names in the database with the same borrowerId.
  can anyone help me? because im a beginner.</p>
  <p>here is my code:</p>
  <pre><code>foreach (ListViewItem item in this.lb_bookList.Items)
             {
                  for (int i = 0; i &lt; item.SubItems.Count; i++)
                  {
  
  
                      int bookId = i;
  
                      //Inserting into a database
                      String requestBook = &quot;INSERT INTO tbl_borrowedbooks(BorrowerID, BookID, DateRequested, Status) Values('&quot; + getUser + &quot;','&quot; + bookId + &quot;','&quot; + date + &quot;',&quot; + &quot;' Requested')&quot;;
                      MySqlCommand datacommand = new MySqlCommand(requestBook, databaseConnection);
                      
                          databaseConnection.Open();
                          datacommand.ExecuteReader();
  
                      
                  }
              }
  </code></pre>