コード例 #1
0
        private void BtnMGiris_Click(object sender, EventArgs e)
        {
            OleDbCommand    komut  = new OleDbCommand();
            OleDbCommand    komut1 = new OleDbCommand();
            OleDbDataReader adtr;
            string          ad       = TxtMKullaniAdi.Text;
            string          sifre    = TxtMParola.Text;
            OleDbConnection baglanti = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\kutuphaneveritabanı.mdb");

            baglanti.Open();
            komut.Connection = baglanti;


            komut.CommandText = "SELECT * FROM TblKullanici where KullaniciAdi='" + TxtMKullaniAdi.Text + "' AND Parola='" + TxtMParola.Text + "'";
            adtr = komut.ExecuteReader();
            if (adtr.Read())
            {
                FrmAdmin Frmadmin = new FrmAdmin();
                Frmadmin.Show();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı ya da şifre yanlış");
                TxtMParola.Clear();
                TxtMKullaniAdi.Focus();
            }


            baglanti.Close();
            Dispose();
        }
コード例 #2
0
        private void GeriDon_Click(object sender, EventArgs e)
        {
            FrmAdmin Frmadmin = new FrmAdmin();

            Frmadmin.Show();
            Dispose();
        }