private void simpleButton1_Click(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("select * from Tbl_Admin where KullaniciAd=@p1 and Sifre=@p2", bgl.baglanti()); komut.Parameters.AddWithValue("@p1", txtAd.Text); komut.Parameters.AddWithValue("@p2", txtSifre.Text); SqlDataReader dr = komut.ExecuteReader(); if (dr.Read()) { FrmAnaModul frm = new FrmAnaModul(); frm.kullanici = txtAd.Text; frm.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BtnGirisYap_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand("SELECT * FROM TBL_ADMIN WHERE KullaniciAd = @p1 AND KullaniciSifre = @p2", bgl.baglanti()); cmd.Parameters.AddWithValue("@p1", txtkullanicad.Text); cmd.Parameters.AddWithValue("@p2", txtsifre.Text); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { FrmAnaModul frmanamodul = new FrmAnaModul(); frmanamodul.Show(); frmanamodul.kullanici = txtkullanicad.Text; this.Hide(); } else { MessageBox.Show("Hatalı Kullanıcı Adı veya Şifre", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error); } bgl.baglanti().Close(); }
void admingiris() { SqlCommand cmd = new SqlCommand("Select * From TBL_ADMİN where KullaniciAd=@p1 and Sifre=@p2", bgl.baglanti()); cmd.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text); cmd.Parameters.AddWithValue("@p2", TxtSifre.Text); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { FrmAnaModul fr = new FrmAnaModul(); fr.kullanici = TxtKullaniciAd.Text; fr.Show(); this.Hide(); } else { MessageBox.Show("Hatalı Giris Yaptınız.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } bgl.baglanti().Close(); }
private void BtnGirisYap_Click(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("Select *from TBL_ADMIN " + "WHERE KULLANICIAD=@P1 AND SIFRE=@P2", bgl.baglanti()); komut.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text); komut.Parameters.AddWithValue("@p2", TxtSifre.Text); SqlDataReader dr = komut.ExecuteReader(); if (dr.Read()) { FrmAnaModul fr = new FrmAnaModul(); fr.kullanici = TxtKullaniciAd.Text; fr.Show(); this.Hide(); } else { MessageBox.Show("Hatalı Kullanıcı Adı yada Şifre", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void button1_Click(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("Select * from TBL_ADMIN where Kullaniciadi=@p1 and Sifre=@p2", bgl.baglanti()); komut.Parameters.AddWithValue("@p1", txtkullanici.Text); komut.Parameters.AddWithValue("@p2", txtsifre.Text); komut.ExecuteNonQuery(); SqlDataReader dr = komut.ExecuteReader(); if (dr.Read()) { fr = new FrmAnaModul(); fr.kullanici = txtkullanici.Text; fr.Show(); this.Hide(); } else { MessageBox.Show("Hatalı Kullanıcı Adı ya da Şifre", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); } bgl.baglanti().Close(); }