I have Web Service that I am accessing that has as part of it's definition a
couple of objects (employees and employee). Employees has 4 properties -
one being an array of "employee" objects.
********************************************
Public Class Employees
Public AuthGUID As String
Public TransactionID As String
Public NoofEmployees As Integer
Public ArrEmployee() As Employee
End Class
Public Class Employee
Public ExternalGUID As String
Public Action As String
Public EmployeeID As String
Public SupervisorName As String
Public CardNumber As String
End Class
************************************************** **********
I have set in my code:
Dim FTSEmployees As Employees = New Employees
Dim FTSEmployee As Employee = New Employee
I can do:
FTSEmployee.ArrEmployee(0).CardNumber = "1234"
and I can do:
FTSEmployee.EmployeeID = newHire.EmployeeNumber
FTSEmployee.SupervisorName = newHire.Officer
FTSEmployee.CardNumber = "1234 "
But I can't do:
FTSEmployees.ArrEmployee(0) = FTSEmployee
I get the error:
System.NullReferenceException: Object reference not set to an instance of an
object.
Line 130: FTSEmployees.ArrEmployee(0) = FTSEmployee
What is cause this? Obviously FTSEmployee.ArrEmployee(0) is an object as I
can do the above line and FTSEmployee is an employee as I am setting all the
properties before I do this line.
What is the error for?
Thanks,
Tom