I'm using VB.Net with MySQL Database and I want to check if the username and password match on the database values Example: Username= Admin11 is different from Username= admin11 when the user entered lowercase "a" and in the database its Uppercase"A" it is wrong. what I want to happen is when the user entered the username that it's not exactly the username in the database values username is incorrect here's my code but it's not working
Dim con = New MySqlConnection
con.ConnectionString = "server=localhost;userid=root;password=alpine;port=3305;database=pos_db;pooling=false;SslMode=none"
con.Open()
Dim qry As String = "SELECT COUNT(*) FROM pos_db.tblusers WHERE Username=@user AND Password=@pass"
Dim cmd As New MySqlCommand(qry, con)
cmd.Parameters.AddWithValue("@user", txtUsername.Text)
cmd.Parameters.AddWithValue("@pass", txtPassword.Text)
Dim count As Integer = Convert.ToInt32(cmd.ExecuteScalar())
If count <> 0 Then
Me.Hide()
FrmSelect.Show()
Else
MessageBox.Show("Either username or password in incorrect", "System", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If