It's usually harder to make things case insensitive.
If you compare to strings, you have case sensitivity. There are options in VB for textual comparsionas and binary comparisions. I believe it's option. Play with some string comparisons of "RED" and "Red". I'm very sure it's already there.
how to make password(login form) case sensitive?
noiseunion
A copy of the items or object may be in the database but when there are compared they are in memory and the same rules apply.
Mark Cooray
Be careful
The following code you'd think was case sensitive.
If "red" = "RED" Then
MsgBox("Same")
Else
MsgBox("Diff")
End If
Add the line at the top of the code file.
Option Compare Text
Now change the line to
Option Compare Binary
Option Compare can make code case sensitive or insensitive.
Derek Ju
I got it now thx....
Dim theDataReader As SqlClient.SqlDataReader = theSqlCommand.ExecuteReader(CommandBehavior.CloseConnection)
Dim pass As Object = Nothing
pass = theDataReader("password")
if pass <> password.text then
msgbox ("incorrect username/password")
Else
'do what ever you want!!!
End If
-ruBBerRFly-
That's what I was alluding to earlier Spotty.
TinSoldier
u mean this
Option Compare Binary
If "red" = "RED" Then
MsgBox("DIff")
Else
MsgBox("Same")
End If
what if items in database
dim pass as object = nothing
pass = theDataReader("password")
Option Compare Binary
if pass <> textbox1.text then
msgbox ("diff")
else
msgbox ("same")
end if
Listing
matthew lyden
It's usually harder to make things case insensitive.
If you compare to strings, you have case sensitivity. There are options in VB for textual comparsionas and binary comparisions. I believe it's option. Play with some string comparisons of "RED" and "Red". I'm very sure it's already there.
smogit
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
If "red" <> "Red" Then _
MsgBox("A Case sensitive comparison was made.")
End Sub
End Class
It's in the properties of the system.string class and logical comparisions.