i'm new to vb.net and i made a login using vb.net and i linked the login to a database , and i found a error in verifying the password. if the password is AbC, it also alows the abc, ABC, aBC s. I just want to set it to the specified password to be allowed.
Hope you can understand my problem.
here are my codes.

PrivateSub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click

Dim UTable AsNew DataTable()
Dim URow As DataRow
UTable = Methods.AddTable("Select Pw,UName from Users where UName = '" &_txtName.Text & "' and Pw= '" & txtpassword.Text & "'", "Users ")

'Validating username & password
If UTable.Rows.Count = 0 Then
MsgBox("You have entered an invalid username or password. Please enter the correct details and try again.", MsgBoxStyle.Exclamation, "")
txtpassword.Text = ""
txtName.Text = ""
txtName.Focus()
Else
frmUsers.ShowDialog()
Me.Hide()
EndIf

In such cases to not change all database setting to be case sensitive I usually cast it to varbinary

select lmlmlaa from lmlmlaa where
CAST(columnName AS varbinary(8)) = CAST(@value AS varbinary(8))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.