Note that there are some explanatory texts on larger screens.

plurals
  1. PORecognizes the Username but Not the Password
    text
    copied!<p>I've set up a database with dummy accounts in it. My login page is able to identify the <strong>Username</strong> but <em>not</em> the <strong>Password</strong>. I've double-checked the Passwords and they're correct. Not sure why it only sees the Username. Please advise.</p> <p>My database looks like this:<br /> <strong>UserID</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>UserName</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Password</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>LastName</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>FirstName</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Email</strong><br /> 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;barb@hotmail.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;coo1Talk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lee&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Barb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;barb@hotmail.com<br /> 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esther@hotmail.com&nbsp;&nbsp;k1dd13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Esther&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;esther@hotmail.com<br /><br /></p> <p>And here is my code-behind file:</p> <pre><code>Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Data.SqlClient Imports System.Configuration Partial Class SignIn Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) End Sub Protected Sub signinBTN_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim sConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("TrackTicketsConnectionString2").ConnectionString) sConnection.Open() Dim cmdS As String = "Select count(*) from Users where UserName='" + usernameTXTBOX.Text + "' AND Deleted='N'" Dim cmdCheckUser As New SqlCommand(cmdS, sConnection) Dim num As Integer = Convert.ToInt32(cmdCheckUser.ExecuteScalar().ToString()) If num = 1 Then Dim cmdS1 As String = "Select * From Users WHERE UserName='" + usernameTXTBOX.Text + "' AND Deleted='N' AND Password='" + passwordTXTBOX.Text + "'" Dim pass As New SqlCommand(cmdS1, sConnection) Dim password As String = pass.ExecuteScalar().ToString() If password = passwordTXTBOX.Text Then Session("Ticket") = usernameTXTBOX.Text Response.Redirect("mysupport.aspx") Else userCOMPARELBL.Visible = True userCOMPARELBL.Text = "Password is incorrect." End If Else userCOMPARELBL.Visible = True userCOMPARELBL.Text = "Username is incorrect." End If End Sub End Class </code></pre> <p>The result I'm expecting is that the user can successfully login and be redirected to another page named support.aspx .</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload