private void button2_Click(object sender, EventArgs e) { if (comboBox1.SelectedValue.ToString() == comboBox2.SelectedValue.ToString()) { MessageBox.Show("Select Two Different Team"); } else { UpdateDBLin ul = new UpdateDBLin(); ul.InsertMatch(comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), dateTimePicker1.Value.Date + dateTimePicker2.Value.TimeOfDay); MessageBox.Show("Match Inserted"); } }