title: How to show all data results to listview?
body: <p>I have a code here showing the data from sqldatabase to listview when searching.</p>
  
  <pre><code> int flag = 0;
  
          connectionstatus();
  
          SqlCommand cmd = new SqlCommand("SELECT *FROM SampleDatabase WHERE IdNo=@IdNo", conn);
          cmd.Parameters.Add("@IdNo", SqlDbType.VarChar).Value = txtIdNo.Text;
          SqlDataReader objRead = cmd.ExecuteReader();
          lvlist.Items.Clear();
          while (objRead.Read())
          {
              if ((txtIdNo.Text) == (objRead["IdNo"].ToString()))
              {
                  flag = 1;
                  break;
              }
          }
          if (flag == 1)
          {
              ListViewItem list = new ListViewItem(basa["FID"].ToString());
              list.SubItems.Add(objRead["FullName"].ToString());
              list.SubItems.Add(objRead["Age"].ToString());
              list.SubItems.Add(objRead["Gender"].ToString());
              list.SubItems.Add(objRead["Relationship"].ToString());
              list.SubItems.Add(objRead["SkillnOccupation"].ToString());
              lvlist.Items.AddRange(new ListViewItem[] { list });
          }
  </code></pre>
  
  <p>My problem is that when im searching and the database have data with the same IdNo it only shows 1 result.  How can i show all the results that has the same IdNo? Can you guys help me out in this. Thanks in advance.</p>