private void button1_Click(object sender, EventArgs e) { string kullaniciAdi = textBox1.Text; string sifre = textBox2.Text; con = new SqlConnection("Data Source=LAPTOP-T1ORC6LM\\SQLEXPRESS;Initial Catalog=login;Integrated Security=True"); cmd = new SqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "SELECT * FROM ogretmenler where kullaniciAdi='" + textBox1.Text + "' AND sifre='" + textBox2.Text + "'"; dr = cmd.ExecuteReader(); if (dr.Read()) { con.Close(); OgretmenGiris frm1 = new OgretmenGiris(); frm1.Close(); Soru_Ekle frm2 = new Soru_Ekle(); frm2.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz."); } }
private void button1_Click(object sender, EventArgs e) { Giris frm1 = new Giris(); frm1.Close(); OgretmenGiris frm2 = new OgretmenGiris(); frm2.Show(); this.Hide(); }