private void loadAvialbleExams(string cname) { OnlineExam ent = new OnlineExam(); var course = ent.Select_Course_byName(cname).First(); int cid = course.Course_ID; var exames = from ex in ent.Exams where ex.CrsId == cid select ex; if (exames.Count() == 0) { flowLayoutPanel1.Controls.Clear(); comboBox1.Items.Clear(); comboBox1.Text = string.Empty; Label nolabel = new Label(); nolabel.Text = "There Is No Exams Available"; nolabel.Size = new Size(350, 30); nolabel.ForeColor = Color.FromArgb(239, 155, 25); nolabel.Font = new Font("Microsoft Sans Serif", 18); flowLayoutPanel1.Controls.Add(nolabel); ExamID = -1; StartButtonStatus(); } else { flowLayoutPanel1.Controls.Clear(); comboBox1.Items.Clear(); foreach (var item in exames) { string exam = $"{item.Enumber}, {item.Edescription}"; comboBox1.Items.Add(exam); } } }