VB.NET:
Private Sub LoginCheck()
If txtLogin.Text.Trim.Length = 0 Then
MessageBox.Show("Please type a Username.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
txtLogin.Focus()
Exit Sub
ElseIf txtPasswordLogin.Text.Trim.Length = 0 Then
MessageBox.Show("Please type your Password.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
txtPasswordLogin.Focus()
Exit Sub
End If
Dim dbDataReader As OleDb.OleDbDataReader = Nothing
Dim sqlCommand1 As String = "SELECT * FROM StreetGangWars WHERE Account = '" & txtLogin.Text & "'"
Dim sqlCommand2 As String = "SELECT * FROM StreetGangWars WHERE Access = '" & txtPasswordLogin.Text & "'"
Dim sqlCommand3 As String = "SELECT * FROM StreetGangWars WHERE ID = @txtlogin.text AND @txtPasswordLogin.Text"
dbDataReader = performQuery(connectionString, sqlCommand1)
If dbDataReader.HasRows Then
dbDataReader = performQuery(connectionString, sqlCommand2)
If dbDataReader.HasRows Then
If dbDataReader.Read Then
MessageBox.Show("Login Success.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
frmCharacter.Visible = True
frmCharacter.Focus()
txtPasswordLogin.Clear()
Me.Visible = False
Me.Enabled = False
End If
Else
MessageBox.Show("Incorrect Password.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
txtPasswordLogin.Focus()
End If
Else
MessageBox.Show("Account not found.", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
txtLogin.Focus()
End If
End Sub
example: username password
solid2005 12345
solid9889 11111
I can login solid2005 using password 11111 and 12345
same goes for solid9889.
what is the problem? help please.