private void simpleButton2_Click(object sender, EventArgs e) { Kitaplar frm = new Kitaplar(); frm.Show(); this.Hide(); }
private void GirisYap_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string ad = textEdit1.Text; string sifre = textEdit2.Text; con = new SqlConnection("Data Source=CASPERNIRVANA;Initial Catalog=Kutuphane;Integrated Security=True"); cmd = new SqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "Select * From Kullanıcı_Giris where k_ad='" + textEdit1.Text + "' AND k_sifre='" + textEdit2.Text + "'"; dr = cmd.ExecuteReader(); if (dr.Read()) { Kitaplar frm = new Kitaplar(); this.Hide(); frm.Show(); } else { MessageBox.Show("Kullanıcı Adı veya Şifreyi Hatalı Girdiniz"); } con.Close(); } }