示例#1
0
        private void anaSayfaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AnaForm frm = new AnaForm();

            frm.Show();
            this.Hide();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlCommand giris = new SqlCommand("select * from Tbl_PersonelGiris where KulaniciAd=@p1 and KullaniciSifre=@p2", Bgl.Baglanti());

            giris.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text);
            giris.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader dr = giris.ExecuteReader();

            if (dr.Read())
            {
                AnaForm frm = new AnaForm();
                frm.kullaniciAd = TxtKullaniciAd.Text;
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya Şifre HATALI ", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Temizle();
            }
        }