title: C# - How to use ListView and SQLite database
body: <p>I'm trying to add some data from a SQLite database, inside a ListView.
  I'm having some difficulties as I want to insert all the data of the column and not a single record.</p>
  
  <p>TEST CODE:</p>
  
  <p><strong>Form1.cs {Load}</strong></p>
  
  <pre><code>private void home_form_Load(object sender, EventArgs e)
          {
              listView1.Refresh();
  
              listView1.View = View.Details;
              listView1.Columns.Add("ID");
              listView1.Columns.Add("Grado");
              listView1.Columns.Add("Cognome");
              listView1.Columns.Add("Nome");
              listView1.Columns.Add("Status");
          }
  </code></pre>
  
  <hr>
  
  <p><strong>Form1.cs {menu_button_gestionepax}</strong></p>
  
  <pre><code>private void menu_button_gestionepax_Click(object sender, EventArgs e)
          {
              menu_button_dashboard.BackColor = System.Drawing.Color.DeepSkyBlue;
              panel_dashboard.Visible = false;
              gestionepersonale_panel.Visible = true;
              menu_button_gestionepax.BackColor = System.Drawing.Color.Blue;
  
              listView1.Refresh();
              ListViewItem lst = new ListViewItem();
              lst.SubItems.Add(LoadUsers.ManagerFind());
              lst.SubItems.Add(LoadUsers.ManagerFind());
              lst.SubItems.Add(LoadUsers.ManagerFind());
              lst.SubItems.Add(LoadUsers.ManagerFind());
              lst.SubItems.Add(LoadUsers.ManagerFind());
  
              listView1.Items.Add(lst);
  
              /*
              string[] row = { LoadUsers.ManagerFindid(), LoadUsers.ManagerFindid() };
              var listViewItem = new ListViewItem(row);
              infobox_listview.Items.Add(listViewItem);
              */
          }
  </code></pre>
  
  <p><strong>LoadUsers.cs</strong></p>
  
  <pre><code>public dynamic string ManagerFind()
  {
      using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
      {
          var select = cnn.Query($"select id from utenti");
  
          if (select.Any())
          { return select[0].ToString(); }
          else return "wrong";
      }
  }
  </code></pre>
  
  <p>I have also done various other tests and one of the difficulties in some cases is to call <strong>string ManagerFind()</strong> from <strong>LoadUsers.cs</strong></p>