private void LoadItemList() { SqlDataReader dr; ListViewItem lvi; this.Cursor = Cursors.WaitCursor; dr = CBCustomer.GetList(); lvwItems.Items.Clear(); while (dr.Read()) { lvi = new ListViewItem(); lvi.Text = dr["ID"].ToString(); lvi.SubItems.Add(dr["Number"].ToString()); lvi.SubItems.Add(dr["Name"].ToString()); lvwItems.Items.Add(lvi); } lvwItems.ColumnClick += new ColumnClickEventHandler(lvwItems_ColumnClick); dr.Close(); dr = null; sbPanStatus.Text = lvwItems.Items.Count.ToString() + " customer(s)"; this.Cursor = Cursors.Default; }
private void LoadCustomerBox() { SqlDataReader dr; RSLib.COListItem li; dr = CBCustomer.GetList(); cboCustomer.Items.Clear(); while (dr.Read()) { li = new RSLib.COListItem(); li.ID = Convert.ToInt32(dr["ID"]); li.Description = dr["Name"].ToString(); cboCustomer.Items.Add(li); } dr.Close(); }