示例#1
0
        private void button_login_Click(object sender, EventArgs e)
        {
            GenericDatabase genericDatabase = new GenericDatabase();
            int             ex = (int)genericDatabase.QuerySQL(string.Format("Select COUNT(*) from THONGTINTAIKHOA where taikhoan='{0}' AND matkhau='{1}'", textBox_TaiKhoan.Text, textBox_MatKhau.Text));

            if (ex >= 1)
            {
                MessageBox.Show("Đăng nhập thành công");
                Close();
            }
            else
            {
                MessageBox.Show("Đăng nhập thất bại");
                Application.Exit();
            }
        }