// Update private void button2_Click(object sender, EventArgs e) { if (comboBox2.SelectedItem == null) { MessageBox.Show("Choose course id"); } else { using (Online_Exame ent = new Online_Exame()) { int c_id = int.Parse(comboBox2.SelectedItem.ToString()); ent.UpdateTopic(int.Parse(comboBox1.Text), c_id, textBox1.Text); textBox1.Text = comboBox1.Text = comboBox2.Text = string.Empty; loadDataGrid(c_id); } } }