Example #1
0
 /// <summary>
 /// 在CheckListBox中显示某个考场的考号组
 /// </summary>
 /// <param name="kcName">考场名称</param>
 private void showAll(string kcName)
 {
     #region 先清空listBox1列表
     if (listBox1.Items.Count > 0)
     {
         listBox1.DataSource = null;
         listBox1.Items.Clear();
     }
     #endregion
     db_theExamNo manage   = new db_theExamNo();
     string       strWhere = "";
     if (kcName == "")
     {
         strWhere = "id>0 order by id desc";
     }
     else
     {
         strWhere = "kaochangname='" + kcName + "' order by id desc";
     }
     DataTable dtList = manage.GetList(strWhere).Tables[0];
     listBox1.DataSource    = dtList.DefaultView;
     listBox1.ValueMember   = "ID";
     listBox1.DisplayMember = "remark";
     listBox1.SelectedIndex = -1;
 }