private void BtnGirisYap_Click(object sender, EventArgs e) { EntityUrunTakipEntities entity = new EntityUrunTakipEntities(); var sorgu = from x in entity.AdminTable where x.Username == TxtKullaniciAd.Text && x.Password == TxtSifre.Text select x; if (sorgu.Any()) { FrmAnaform frmAnaform = new FrmAnaform(); frmAnaform.Show(); this.Hide(); } else { MessageBox.Show("Hatalı Giriş!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }