예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FmAnasayfa gecis = new FmAnasayfa();

            gecis.Show();
            this.Hide();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string user = textBox1.Text;
            string pass = textBox2.Text;

            con = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=DbKantar;Integrated Security=True");
            cmd = new SqlCommand();
            con.Open();

            cmd.Connection  = con;
            cmd.CommandText = "SELECT * FROM TbLogin where Kullanici='" + textBox1.Text + "' AND Sifre='" + textBox2.Text + "'";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                /* MessageBox.Show("Tebrikler! Başarılı bir şekilde giriş yaptınız.");*/
                Kullanici = textBox1.Text;
                FmAnasayfa gecis = new FmAnasayfa();
                gecis.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz.");
            }
            con.Close();
        }