private void simpleButton7_Click(object sender, EventArgs e) { Menü frm = new Menü(); frm.Show(); this.Hide(); }
private void GirisYap_Click(object sender, EventArgs e) { if (checkBox1.Checked) { Properties.Settings.Default.kuladi = textEdit1.Text; Properties.Settings.Default.sifre = textEdit2.Text; Properties.Settings.Default.Save(); } else { Properties.Settings.Default.kuladi = null; Properties.Settings.Default.sifre = null; Properties.Settings.Default.Save(); } 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()) { Menü frm = new Menü(); frm.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı Adı veya Şifreyi Hatalı Girdiniz"); } con.Close(); }