Hi i want my login to be case sensitive but it is not so, and i don't know how to fix it. Here is my code:
Private Sub btn_login_Click_1(sender As Object, e As EventArgs) Handles btn_login.Click
Dim username, password As String
Dim message As String = "The username or password was incorrect, please try again"
username = txt_username.Text
password = txt_password.Text
If Me.UsernamesTableAdapter1.ScalarQueryLogin(username, password) And txt_username.Text = "admin" Then
Form2.Show()
txt_username.Text = ""
txt_password.Text = ""
System.Media.SystemSounds.Asterisk.Play()
MessageBox.Show("Successfully logged in as Admin", "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf Me.UsernamesTableAdapter1.ScalarQueryLogin(username, password) Then
Form2.Show()
txt_username.Text = ""
txt_password.Text = ""
System.Media.SystemSounds.Asterisk.Play()
MessageBox.Show("Successfully logged in as User", "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
System.Media.SystemSounds.Exclamation.Play()
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
txt_username.Text = ""
txt_password.Text = ""
End If
End Sub
Here is my ScalarQuery
SELECT * FROM Usernames Where Username = ? AND Password = ?