Beispiel #1
0
        private void LoadItemList()
        {
            SqlDataReader dr;
            ListViewItem  lvi;

            this.Cursor = Cursors.WaitCursor;

            dr = CBEmployeeTitle.GetList();
            lvwItems.Items.Clear();
            while (dr.Read())
            {
                lvi = new ListViewItem();

                lvi.Text = dr["ID"].ToString();
                lvi.SubItems.Add(dr["Name"].ToString());

                lvwItems.Items.Add(lvi);
            }

            lvwItems.ColumnClick += new ColumnClickEventHandler(lvwItems_ColumnClick);
            // *************** this line was added, MZ

            dr.Close();
            dr = null;

            sbPanStatus.Text = lvwItems.Items.Count.ToString() + " title(s)";

            this.Cursor = Cursors.Default;
        }
Beispiel #2
0
        private void LoadTitleBox()
        {
            SqlDataReader dr;

            RSLib.COListItem li;

            dr = CBEmployeeTitle.GetList();

            cboTitle.Items.Clear();
            while (dr.Read())
            {
                li = new RSLib.COListItem();

                li.ID          = Convert.ToInt32(dr["ID"]);
                li.Description = dr["Name"].ToString();

                cboTitle.Items.Add(li);
            }

            dr.Close();
        }