为什么我一直保持空虚

时间:2014-01-02 15:57:23

标签: .net arraylist nullreferenceexception

我有一个asp.net 2010应用程序。当我尝试填充下面的类时,我不断得到NullReferenceException,我无法弄清楚为什么。我在New()中实例化ArrayLists。

<Serializable()> _
Public Class Yaya
    Public Sub New()
        _People = New ArrayList
        _PhysicalHouseholds = New ArrayList
        _TaxReturns = New ArrayList
    End Sub

    Public Property People() As ArrayList
    Public Property PhysicalHouseholds() As ArrayList
    Public Property TaxReturns() As ArrayList
End Class

以下是填充此类失败的代码....

    Dim oYaya As New Yaya
    Dim oPerson As New Applicant

    oPerson.isApplicant = "Y"
    oPerson.disabled = "N"
    oPerson.student = "N"
    oPerson.eligible = "N"
    oPerson.incarcerated = "N"
    oPerson.livesInState = "Y"

 oYaya.People.Add(oPerson)

MyClass在那里......人在那里。但是,当MyClass对象被创建时,MyClass中的People ArrayList就没什么了解的。

0 个答案:

没有答案