private void button1_Click(object sender, EventArgs e) { DbEntitiyEntities db = new DbEntitiyEntities(); var sorgu = from x in db.Tbl_Admin where x.KULLANICI == textBox1.Text && x.SİFRE == textBox2.Text select x; if (sorgu.Any()) { FrmAnaForm fr = new FrmAnaForm(); fr.Show(); this.Hide(); } else { MessageBox.Show("Hatalı Giriş"); } }