Sử dung phương thức ExecuteReader() trong SqlCommand để kiểm tra đăng nhập
{
string chuoiketnoi = @"server =SCD081815; database = thuchanh;integrated security=true;";
SqlConnection ketnoi = new SqlConnection();
ketnoi.ConnectionString = chuoiketnoi;
ketnoi.Open();
SqlCommand lenh = new SqlCommand();
lenh.Connection = ketnoi;
lenh.CommandText = string.Format("select count(*) from Sinhvien where masv ='{0}' and pass = '{1}'", textBox1.Text, textBox2.Text);
SqldataReader reader = lenh.ExecuteReader();
if (reader.HasRow==true)
MessageBox.Show("Đang nhập thành công");
else
MessageBox.Show("Đang nhập thất bại");
ketnoi.Close();
}
- Tìm hiểu quy ước đặt tên thiết bị lưu trữ trong Linux
- Tìm hiểu cấu trúc i-node và cách đọc thông tin tệp tin trong Linux
- Xu hướng mới trong phân tích và thiết kế hệ thống thông tin
- MuZero – Thuật toán Trí tuệ nhân tạo có khả năng tự học mạnh mẽ
- Chủ đề OSCP (Port Redirection and SSH Tunneling) (tiếp theo)