NULLReference异常C#ASP.Net(变量填充但我得到了异常)

时间:2017-03-04 05:38:50

标签: c# asp.net exception

oQual是一个类变量,它被分配给下面代码中显示的其中一个参数,问题是如果在运行时观察这个变量它已经填充了正确的值但是我在评论中得到NULLReference异常线。

    Programme oPrograme;
    private Qualification oQual;

    public ProgrammeList(Qualification oQualification)
    {
        oPrograme = new Programme();
        oQual = new Qualification();
        oQual = oQualification;

        this.tQID.Text = oQual.getQualficationID().ToString(); //oQual is already populated yet i am getting null reference expection on this line
        this.tProgName.Text = oQual.getQualificationName();
        this.tProg_Saqa_reg_no.Text = oQual.getQualificationNqfLevel();
        this.tProg_nqf_level.Text = oQual.getQualificationSaqaNo();

    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

enter image description here enter image description here

0 个答案:

没有答案