Having issue with when I am basically having an app that when a textbox enters a email address from array, array is iterated to search for condition if true then displays the other information like Hair, Language, and Gender (also in array). Now if there is nothing then display "No data found". Now my issue here is that I have the following code, but cannot be able to call a function from button click to another function, which that function calls another function to have the data displayed or show message.
My code is below:
Imports System.Collections
Imports System.Web.Mail
Imports System
Imports System.Net.Sockets
Imports System.Text
Imports System.IO
Public Class WebForm1
Inherits Global.System.Web.UI.Page
Private Function DetectServerSettings(ByRef emailaddress As String, ByRef Hair As String,
ByRef Age As Integer,ByRef Language As String, ByRef USCitizen As Boolean)
'Should have no knowledge of test cases and controls used. here is as email address entered, display data.
Return Hair
Return Language
Return Age
Return USCitizen
End Function
'error happens here converting label type to string when data is integer.
Overloads Sub btn_Click(sender As Object, e As EventArgs) Handles btnCheckList.Click, btnCheckList.Click
DetectServerSettings(emailaddress:=lblMessage1.ToString(), Hair:=lblMessage3.ToString(), Language:=lblMessage4.ToString(),
Age:=lblMessage5.ToString(), USCitizen:=lblMessage6.ToString())
End Sub
Private Sub GetInfo(ByRef emailaddress As String, ByRef pwd As String, ByRef HairAs String, ByRef Language As String, ByRef Age As Integer, ByRef USCitizen As Boolean)
Dim arrProperties As Array = { {"sample@sample.com", "Black", "Spanish", 2000, No},
{"sample2@sample2.com", "Blonde", "English", 25, True}}
Dim i As Integer
For i = 0 To arrProperties.Length - 1
If arrProperties.Equals(emailaddress) Then ' And arrProperties.Equals(pwd)
Console.WriteLine("Hair: " + Hair+ "/n" + "Language: " + Language+ "/n" + "Age: " + Age+ "/n" + "US Citizen? : " + USCitizen+ "/n")
ElseIf arrProperties Is Nothing Then
Console.WriteLine("Sorry, No Data Found.")
End If
Next
End Sub
End Class