MySqlConnection bag = new MySqlConnection("Server = localhost; database = ; uid = ; pwd = ");
MySqlDataReader oku;
MySqlCommand kom = new MySqlCommand();
kom.Connection = bag;
bag.Open();
kom.CommandText = "select *from yetkiligiris where ad = '"+textBox1.Text+"' and soyad = '"+textBox2.Text+"' and gorev = '"+comboBox1.SelectedItem+"'";
oku = kom.ExecuteReader();
if (oku.Read())
{
Form2 ans = new Form2();
this.Hide();
ans.Show();
kom.CommandText = "insert into yetkiligiris (ad,soyad,gorev,trh) values ('"+textBox1.Text+ "', '"+textBox2.Text+ "', "+comboBox1.SelectedItem+"', '"+ DateTime.Now.ToString("dd.MM.yyyy - H:mm:ss") + "')";
kom.ExecuteNonQuery();
bag.Close();
}
else
{
label4.Text = "Yanlış veri girdiniz.";