C# Form ile Giriş paneli

 private void button1_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("select*from tbl_giris where kullanici_ad = @p1 and sifre =@p2",baglanti);
            komut.Parameters.AddWithValue("@p1",textBox1.Text);
            komut.Parameters.AddWithValue("@p2", textBox2.Text);
            SqlDataReader oku = komut.ExecuteReader();
            if (oku.Read())
            {
                FrmAnaform frm = new FrmAnaform();
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre Yanlış","giriş hatalı",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
            baglanti.Close();
        }


Yorumlar

Bu blogdaki popüler yayınlar

SQL Group By Kullanımı

C# Armstrong sayı bulma.

C# Dosya Taşıma Form Application