Пример #1
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            mailgonder.ActiveForm.Hide();
            anaekran ekrn = new anaekran();

            ekrn.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string           sql  = "select * from login where kullaniciAdi=@kullaniciAdi and sifre=@sifre";
            String           ccon = "Server=127.0.0.1; Database=rfiddb;uid=root;pwd=root";
            MySqlDataAdapter adp  = new MySqlDataAdapter(sql, ccon);

            adp.SelectCommand.Parameters.AddWithValue("kullaniciAdi", textBox1.Text);
            adp.SelectCommand.Parameters.AddWithValue("sifre", textBox2.Text);

            DataTable dt = new DataTable();

            adp.Fill(dt);

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Hatalı giriş yaptınız.");
            }
            else
            {
                this.Hide();
                anaekran nesne = new anaekran();
                nesne.ShowDialog();
            }
        }