0

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
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

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))
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.