Exemple #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            Personelislemleri pers = new Personelislemleri();

            pers.Show();
            this.Hide();
        }
        public void persgit()
        {
            k.kullaniciad = textBox1.Text;
            k.sifre       = textBox2.Text;
            SqlConnection con = new SqlConnection("Data Source=ASUSN750JK;Initial Catalog=DemirbasDB;Integrated Security=True");

            con.Open();

            string sql = "Select * from personelTablo where kullanıcıAd='" + textBox1.Text + "' and (Dept='personel') and kullaniciSifre='" + textBox2.Text + "';";

            SqlCommand     cmd = new SqlCommand(sql, con);
            DataTable      dt  = new DataTable();
            SqlDataAdapter da  = new SqlDataAdapter(cmd);

            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                Personelislemleri prs = new Personelislemleri();
                prs.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("kullanıcı adı veya şifre yanlış");
            }
        }