my code does not seem to work...it only redirects the page if the username and password is empty...
sub login_Click(s as Object, e As EventArgs)
dim conPubs As SqlConnection
dim cmdSelect as SqlCommand
dim name as string
dim name2 as string
dim pass as string
dim pass2 as string
dim passing as SqlDataReader
dim str as String
if IsValid then
conPubs=New SqlConnection("Server=localhost;User Id=sa;Password=edna;database=ES")
str = "Select Password From Passwd Where Name=@Name"
cmdSelect= New SqlCommand(str, conPubs)
cmdSelect.Parameters.Add("@Name", TextBox1.Text )
'cmdSelect.Parameters.Add("@Password", txtPass.Text)
conPubs.Open()
'name = txtPass.Text
'name2 = cmdSelect.ExecuteScalar()
'TextBox1.Text = name
'TextBox2.Text = name2
if txtPass.Text = cmdSelect.ExecuteScalar() then
conPubs.Close()
FormsAuthentication.RedirectFromLoginPage _
(TextBox1.Text, CheckBox1.Checked)
else
TextBox1.Text = ""
conPubs.Close
'Server.Transfer("login.aspx")
end if
end if
end sub