ednayap Posted August 18, 2003 Posted August 18, 2003 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 Quote ##EYPS##
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.