Exemplo n.º 1
0
        private void btntrolai_Click(object sender, EventArgs e)
        {
            this.Hide();
            Frmquanlysv frm = new Frmquanlysv();

            frm.Show();
        }
Exemplo n.º 2
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            SqlConnection  cn = new SqlConnection(@"Data source= .\SQLEXPRESS; Initial Catalog = Quanlysinhvien; Trusted_Connection = yes");
            SqlDataAdapter da = new SqlDataAdapter("select count (*) From Login where USENAME = '" + txtname.Text + "'  and PASSWORD = '******'", cn);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                Frmquanlysv frm = new Frmquanlysv();
                frm.Show();
            }
            else
            {
                MessageBox.Show(" Please check you use nam and password", "Errors", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }