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 :)

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

Edited 5 Years Ago by Jx_Man: n/a

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...

This article has been dead for over six months. Start a new discussion instead.