Object reference not set to an instance of an object.

  • This is an error we are receiving when trying to connect a .net application to a SQL 2000 database.  Any help or comments would be greatly appreciated.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

     
    [NullReferenceException: Object reference not set to an instance of an object.]
       MRMS.MFA.CustomerMgmtUI.OpenCustomer.OpenCustomers() +1824
       MRMS.MFA.CustomerMgmtUI.OpenCustomer.btnOK_Click(Object sender, EventArgs e) +5
       System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +108
       System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain() +1281

     

     

     

  • You need to initiate your object as a new one - in this case the opencutomers object by the look of it - whatever class that is based upon i.e

    public opencustomers as new ........ (in vb)

  • You've got to step into OpenCustomers() and see what's null  there.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply