Пример #1
0
        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 ogrenciler where kullaniciAdi='" + textBox1.Text + "' AND sifre='" + textBox2.Text + "'";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                con.Close();
                OgrenciGiris frm1 = new OgrenciGiris();
                frm1.Close();
                SinavEkrani frm2 = new SinavEkrani();
                frm2.Show();
                this.Hide();
            }

            else
            {
                MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz.");
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            Giris frm1 = new Giris();

            frm1.Close();
            OgrenciGiris frm3 = new OgrenciGiris();

            frm3.Show();
            this.Hide();
        }
Пример #3
0
        private void anaSayfaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SinavEkrani frm1 = new SinavEkrani();

            frm1.Close();
            OgrenciGiris frm3 = new OgrenciGiris();

            frm3.Show();
            this.Hide();
        }