我想执行此查询以使用textbox2中的输入数据计算命令结果。
Dim con As SqlConnection
con = New SqlConnection("server=chinna; uid=sa; pwd=136018@h; database=self")
con.Open()
Dim cmd As SqlCommand
cmd = New SqlCommand("select firstname 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")