moraleskp
asked on
Visual Studio 2005 VB.Net Variable Values Showing in Hex
I developing a windows project in visual studio 2005. I noticed some code is not getting the right results. In the following code sample, If Not IsNothing(ID) Then, is always true. I checked the Value of ID and it was &H0.
How can I fix this? Thanks in advance
How can I fix this? Thanks in advance
Public Sub Login(ByVal UserName As String, ByVal Password As String, ByVal RememberMe As Boolean)
Dim ID As Integer
ID = clsDatabase.GetReaderSingleValue("SELECT ID FROM tblUsers WHERE Username = '" & UserName & "' AND Password = '" & Password & "'", CommandType.Text)
If Not IsNothing(ID) Then
GetUserByID(ID)
Authenticated = True
End If
End Sub
opps, typing error, It should be ...
If Not ID is nothing Then
so the code should be like this
If Not ID is nothing Then
so the code should be like this
Public Sub Login(ByVal UserName As String, ByVal Password As String, ByVal RememberMe As Boolean)
Dim ID As Integer
ID = clsDatabase.GetReaderSingleValue("SELECT ID FROM tblUsers WHERE Username = '" & UserName & "' AND Password = '" & Password & "'", CommandType.Text)
If Not ID is nothing Then
GetUserByID(ID)
Authenticated = True
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window