null reference exception was unhandled by user code

Posted by user238319 on Stack Overflow See other posts from Stack Overflow or by user238319
Published on 2010-02-19T01:43:37Z Indexed on 2010/05/09 20:48 UTC
Read the original article Hit count: 185

Filed under:
|

sir, i develop the following code in vs2005, now i just using this module in my new project @ vs 2008.. But this error was araised. I cant able to fix this problem...

Private Sub DataAccess()

    Dim errHandle As New ErrorHandler
    Dim lobjCommon As New eCopsCommonFunctions
    Try
        AccessCodeDrplst.DataSource = CType(lobjCommon.gfuncGetAllEnrollmentSource(), DataSet)
        AccessCodeDrplst.DataValueField = "DataAccessCode"
        AccessCodeDrplst.DataTextField = "DataAccessDesc"
        AccessCodeDrplst.DataBind()
        'lstEnrollmentSourceCode.DataValueField = "EnrollmentSourceCode"
        'lstEnrollmentSourceCode.DataTextField = "EnrollmentSourceDesc"
        'lstEnrollmentSourceCode.DataBind()
        '"Beneficiary Election" is pre selected as default value. By pals on Oct 24th 2007
        'lstEnrollmentSourceCode.SelectedValue = "B"
        'lstEnrollmentSourceCode.Items.Insert(0, New ListItem("Select", "0"))
    Catch ex As Exception
        errHandle.gProcHandleErrors(ex, Session("MemberID"), "SPStatus.aspx.vb, gprocFillSEPCode")
        Throw ex
    Finally
        lobjCommon = Nothing


        ///here the error occurs as 'NullException was unhandle by the user code'
        errHandle = Nothing
    End Try
End Sub

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about exception-handling