예제 #1
0
 private void bntOK_Click(object sender, EventArgs e)
 {
     SqlCommand command = new SqlCommand();
     command.Connection = con;
     command.CommandType = CommandType.Text;
     command.CommandText = "Select * From tblDangNhap Where (Taikhoan=@user) And (matkhau=@password)";
     command.Parameters.Add("@user", SqlDbType.NVarChar, 50).Value = txtTaiKhoan.Text;
     command.Parameters.Add("@password", SqlDbType.NVarChar, 50).Value = txtMatKhau.Text;
     da.SelectCommand = command;
     da.Fill(dt);
     if (dt.Rows.Count > 0)
     {
         MessageBox.Show("Dang nhap thanh cong");
         Hide();
         frmMain main = new frmMain();
         main.Show();
     }
     else
     {
         MessageBox.Show("Đăng nhập thất bại");
     }
 }
예제 #2
0
 private void HoSo_Click(object sender, EventArgs e)
 {
     Form frm1 = new frmMain();
     frm1.Show();
     Hide();
 }
예제 #3
0
        private void btnThoat_Click_1(object sender, EventArgs e)
        {
            frmMain frm = new frmMain();

            frm.Show();
        }