Function LoginPass() As Boolean
Dim LogPass As New waxClass
Dim Ldt As DataTable = LogPass.LoginPass(LCase(UserName_TextBox.Text),
LCase(UserPass_TextBox.Text))
If Ldt.Rows.Count > 0 Then
waxClass.LMUser = Ldt.Rows(0).Item("Username").ToString
'Utility.LMUserID = Ldt.Rows(0).Item("UserID").ToString
Return True
End If
End Function
When I try to use the above function it gives a warning saying:
Function ‘LoginPass’ doesn’t return a value on all code
paths. Are you missing a ‘Return’ statement?
Your function requires a
Booleanreturn value.You do not have a return value if
Ldt.Rows.Count <= 0, so that is where the warning is coming from. Add andElse Return Falseand you should be fine.