Hello, I want to display the content of my database in list view. The table has 5 columns however when I tried this code
It limits the display to 2 columns. List view will only show the first 2 columns. The code above won't let me add more indexes or subitems. Only up to 2 columns. Please help. Thanks
Code:
string view = "Select * from cust_infor"; SqlCommand cmd = new SqlCommand(view,FL.clsconnection.opencon()); SqlDataReader dr = cmd.ExecuteReader(); listView1.Items.Clear(); while (dr.Read()) { listView1.Items.Add(dr[0].ToString()).SubItems.Add(dr[1].ToString()); }
Comment