hi anyone here knows how to validate user inputs.. when the user logs in and his/her password is in Uppercase(saved in database) but forgets to type in uppercase. and it would display warning message saying invalid password...

any help would be highly appreciated :)

Recommended Answers

All 8 Replies

You need to change the collation at the server.

how do i change the collation?

are you storing the actual password in database as is ?

>>how do i change the collation
read the link provide by adatapost

in addition, you can use string compare function.

Dim i As Integer
i = String.Compare("dani", "DaNi", False)
If i = -1 Then
   MsgBox("Different")
ElseIf i = 0 Then
   MsgBox("Same")
End If

i did set it to collation..i followed the procedure..

where will i put this code in my program?

Dim i As Integer
i = String.Compare("dani", "DaNi", False)
If i = -1 Then
   MsgBox("Different")
ElseIf i = 0 Then
   MsgBox("Same")
End If

no, that just an example code. i just show how to use string compare.
you need to modified it.

Dim i as Integer
Dim PassResult as String

PassResult = (a password taken from database, select result)
i = String.Compare(txtPassword.Text, PassResult, False) ' compare an inputed password with a password from database
If i = -1 Then
   MsgBox("Wrong Password")
ElseIf i = 0 Then
   ' same password, do anything as u wish 
End If
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        TextBox2.Text = UCase(TextBox2.Text)
    End Sub

just make your textbox in uppercase...

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.