protected void btnDangNhap_Click(object sender, EventArgs e) { string strcn = ConfigurationManager.ConnectionStrings["ql"].ConnectionString; SqlConnection cn = new SqlConnection(strcn); string strsl = "select * from tbl_KhachHang where SoDT='" + txtSDT.Text + "' and MatKhau ='" + txtMK.Text + "'"; SqlDataAdapter da = new SqlDataAdapter(strsl, cn); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 1) { Session["kh"] = dt; Response.Redirect("TrangChu.aspx"); } else { Label1.Text = "Thong tin dang nhap sai!"; } }