string ad = textBox2.Text; string sifre = textBox1.Text; con = new MySqlConnection("Server = localhost; Database = manav; Uid = root; Pwd = ''; "); cmd = new MySqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "SELECT * FROM giris where kullanici_giris='" + textBox1.Text + "' AND kullanici_sifre='" + textBox2.Text + "'"; dr = cmd.ExecuteReader(); if (dr.Read()) { Form2 frm = new Form2(); frm.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı adı ya da şifre yanlış"); } con.Close(); } } }