How to use Listview virtual mode for accessing database?
<p>I have this code retrieving data from a database but my problem is that it only shows the last item on my <code>ListViewItem</code>. Here is the code:</p>

<pre><code>    private void patientLvw_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
    {

        cmd = new OleDbCommand("SELECT * FROM PATIENTS ORDER BY PATIENTS.PatientNo;", conn);


        reader = cmd.ExecuteReader();
        while (reader.Read())
        {
            String patientNo = ""; ;
            String lastName = "";
            String firstName = "";
            String middleInitial = "";
            String age = "";
            String address = "";
            String type = "";
            String status = "";
            if (!reader.IsDBNull(0))
            {
                patientNo = reader.GetInt32(0).ToString();
            }

            if (!reader.IsDBNull(1))
            {
                lastName = reader.GetString(1);
            }

            if (!reader.IsDBNull(2))
            {
                firstName = reader.GetString(2);
            }
            if (!reader.IsDBNull(3))
            {
                middleInitial = reader.GetString(3);
            }
            if (!reader.IsDBNull(4))
            {
                age = reader.GetInt32(4).ToString();
            }
            if (!reader.IsDBNull(5))
            {
                address = reader.GetString(5);
            }
            if (!reader.IsDBNull(6))
            {
                type = reader.GetString(6);
            }
            if (!reader.IsDBNull(7))
            {
                status = reader.GetBoolean(7).ToString();
            }

            ListViewItem lvi = new ListViewItem(patientNo);


            e.Item.SubItems.Add(lastName);

            e.Item.SubItems.Add(firstName);
            e.Item.SubItems.Add(middleInitial + ".");
            e.Item.SubItems.Add(age);
            e.Item.SubItems.Add(address + ".");
            e.Item.SubItems.Add(type);
            e.Item.SubItems.Add(status);

            e.Item = lvi;

        }
    }
</code></pre>
