private DataSet ds = null;// public FrmScoreQuary() { InitializeComponent(); this.cboClass.DataSource = new StudentService().GetAllStudentBySet().Tables[0]; this.cboClass.DisplayMember = "ClassName"; this.cboClass.ValueMember = "ClassId"; this.cboClass.SelectedIndex = -1; ds = objScoreListService.GetAllScoreBySet(); this.dgvScoreList.DataSource = ds.Tables[0]; this.cboClass.SelectedIndexChanged += new System.EventHandler(this.cboClass_SelectedIndexChanged); }