I used this code to view the data from the database into the listview: <pre> private void loadtblsupp() { cn.Open(); cmd.CommandText = "select * from SupplierTable"; cmd.Connection = cn; dr = cmd.ExecuteReader(); while (dr.Read()) { ListViewItem item = new ListViewItem(dr["Supp_ID"].ToString()); item.SubItems.Add(dr["Supp_Name"].ToString()); item.SubItems.Add(dr["Supp_Address"].ToString()); item.SubItems.Add(dr["Supp_CPerson"].ToString()); item.SubItems.Add(dr["Supp_TelNo"].ToString()); item.SubItems.Add(dr["Supp_FaxNo"].ToString()); item.SubItems.Add(dr["Supp_Email"].ToString()); supplier_tb.Items.Add(item); } cn.Close(); }
MyForm mf = new MyForm(); mf.Show();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)