示例#1
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("select * from tbl_Yonetici where KullaniciAd=@p1 and Sifre=@p2", baglanti);

            komut.Parameters.AddWithValue("@p1", txtKullaniciAdi.Text);
            komut.Parameters.AddWithValue("@p2", txtSifre.Text);
            SqlDataReader dr = komut.ExecuteReader();

            if (dr.Read())
            {
                FrmAnaForm frm = new FrmAnaForm();
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatali Kullanici Adi ya da Sifre");
            }
            baglanti.Close();
        }
示例#2
0
        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            baglanti.Open();

            SqlCommand komut1 = new SqlCommand("Select * from Tbl_Yonetici where kullaniciadi =@k1 and sifre=@k2", baglanti);

            komut1.Parameters.AddWithValue("@k1", TxtKullaniciAdi.Text);
            komut1.Parameters.AddWithValue("@k2", TxtSifre.Text);
            SqlDataReader dr = komut1.ExecuteReader();

            if (dr.Read())
            {
                FrmAnaForm frm = new FrmAnaForm();
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("GİRDİĞİNİZ KULLANICI ADI VEYA ŞİFRE YANLIŞTIR.", "Bilgi", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
        }
示例#3
0
        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("Select * from Tbl_Yonetici where KullaniciAd=@p1 and Sifre=@p2", baglanti);

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

            if (dr.Read())
            {
                FrmAnaForm frm = new FrmAnaForm();
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya sıfre hatalı");
            }
            baglanti.Close();
        }