I have a function that returns a dataset or a boolean depending upon whether
a record was found. I can check for the string value of the return type, but
i don'r think this is the right way to do it what is the correct method?
any help would be appreciated.
(hey, i'm actually learning how to do this "-------"!
FUNCTION:
' this function will return the a dataset with the current user if
the loogin was successful else if will return a false
Dim DsUser1 As dsUser = New dsUser
Me.SqlDataAdapter1.SelectCommand.Parameters(1).Val ue = thsUserID
Me.SqlDataAdapter1.SelectCommand.Parameters(2).Val ue = thsPassword
Me.SqlDataAdapter1.Fill(DsUser1.usr)
If DsUser1.usr.Count = 0 Then
Return False
Else
Return DsUser1
End If
End Function
function call
If IsValid Then
Try
Dim us As UserServices = New UserServices
Dim usrResult As Object
usrResult = us.fn_Isvalid(Me.txtUserID.Text,
Me.txtPassword.Text)
Me.lblMSG.Text = usrResult.GetType.ToString()
If usrResult.GetType = System.Boolean
Me.lblStatus.Text = User not valid
ELSE
Me.lblStatue.text = usrREsult.usrUserID
End If
Catch ex As Exception
.......
End Try
End If
thanks
kes