我正在尝试从后端获取密码验证,并登录到该页面,但我无法执行此操作。我的疑问是:
Dim con As SqlConnection
con = New SqlConnection("server=chinna; uid=XXXXXX; pwd=XXXXXXX; database=self")
con.Open()
Dim cmd As SqlCommand
cmd = New SqlCommand("select PASSWORD from employees where EmployeeNumber=@param", con)
cmd.Parameters.AddWithValue("param", TextBox1.Text)
Dim rdr As SqlDataReader
rdr = cmd.ExecuteReader
If TextBox2.Text = rdr.ToString() then
Response.Redirect("default.aspx")
Else
MsgBox("incorrect password")