예제 #1
0
        private void loadStudent()
        {
            try
            {
                var dc = new ClassSRMDataContext(Config.connection);

                tblStudentBindingSource.DataSource = dc.SelectStudentByClassId((int)cmbClass.EditValue);
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: esafb52/ClassSRM
        //Load Student
        private void LoadStudent()
        {
            var dc    = new ClassSRMDataContext(Config.connection);
            int count = (cmbClass.Properties.DataSource as IList).Count;

            if (count > 0)
            {
                int id = (int)cmbClass.EditValue;
                tblStudentBindingSource.DataSource = dc.SelectStudentByClassId(id);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }