Unexplained Instance Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marty Cruise

    #1

    Unexplained Instance Error

    I am getting the following error: " Object reference not
    set to an instance of an object."

    The strange thing is that I AM creating a new instance of
    the object in the PageLoad event Iin the code behind)
    just prior to using it's properties, and in fact, the app
    ran perfectly until only recently when I installed
    Project Server on the web server, which should have had
    no impact.

    Is there a security setting or something else that might
    compromise instantiating classes? I'm lost.



  • Kevin Spencer

    #2
    Re: Unexplained Instance Error

    Without looking at your code, there is no way to tell.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

    Some things just happen.
    Everything else occurs.

    "Marty Cruise" <mCruise@noSpam .com> wrote in message
    news:03ce01c341 95$f3a168c0$a10 1280a@phx.gbl.. .[color=blue]
    > I am getting the following error: " Object reference not
    > set to an instance of an object."
    >
    > The strange thing is that I AM creating a new instance of
    > the object in the PageLoad event Iin the code behind)
    > just prior to using it's properties, and in fact, the app
    > ran perfectly until only recently when I installed
    > Project Server on the web server, which should have had
    > no impact.
    >
    > Is there a security setting or something else that might
    > compromise instantiating classes? I'm lost.
    >
    >
    >[/color]


    Comment

    • Kevin Spencer

      #3
      Re: Unexplained Instance Error

      I'm not sure why you're not getting an error on the following line:
      [color=blue]
      > Public myOrder As New cOrder[/color]

      It should read (assuming that the New constructor for cOrder takes no
      arguments):

      Public myOrder As New cOrder()

      See if that doesn't fix it.

      HTH,

      Kevin Spencer
      Microsoft FrontPage MVP
      Internet Developer
      All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

      Some things just happen.
      Everything else occurs.


      "Marty Cruise" <mCruise@noSPam .com> wrote in message
      news:09ea01c341 9d$eeef31b0$a00 1280a@phx.gbl.. .[color=blue]
      > Here is the relevant code. The error occurs when the
      > myOrder.getInfo method is called:
      >
      > =============== ==============
      > Imports cLib
      >
      > Public Class frmPrintTR
      > Inherits System.Web.UI.P age
      > Public myOrder As New cOrder
      > Protected WithEvents lblShipTo As
      > System.Web.UI.W ebControls.Labe l
      > Protected WithEvents Button1 As
      > System.Web.UI.W ebControls.Butt on
      > Protected WithEvents Button2 As
      > System.Web.UI.W ebControls.Butt on
      > Protected WithEvents btnPrint As
      > System.Web.UI.W ebControls.Butt on
      > Protected WithEvents btnClose As
      > System.Web.UI.W ebControls.Butt on
      > Protected WithEvents pDesiredVendor As
      > System.Web.UI.W ebControls.Pane l
      > Protected WithEvents pComments As
      > System.Web.UI.W ebControls.Pane l
      > Protected WithEvents pCommentsNone As
      > System.Web.UI.W ebControls.Pane l
      > Protected WithEvents pItemsNone As
      > System.Web.UI.W ebControls.Pane l
      > Protected WithEvents repItems As
      > System.Web.UI.W ebControls.Repe ater
      >
      > ' # Region stuff omitted from this posting
      >
      > Private Sub Page_Load(ByVal sender As Object, ByVal e
      > As System.EventArg s) Handles MyBase.Load
      > If Request.QuerySt ring("TRID") = "" Then
      > Exit Sub
      > End If
      >
      > myOrder.GetInfo (CInt(Request.Q ueryString("TRI D")))
      > repComments.Dat aSource = myOrder.Comment s
      > repComments.Dat aBind()
      >
      > =============== ==============
      >
      >[color=green]
      > >-----Original Message-----
      > >Check your assumptions:
      > >
      > >if your control is actually there, does the
      > >property/method you use reference yet another control[/color]
      > that[color=green]
      > >is not there?
      > >
      > >Are there other objects referenced on the offending[/color]
      > line?[color=green]
      > >and finally, have you used the debugger and stepped into
      > >the routine causing the problem and checked the object
      > >variables in question?
      > >[color=darkred]
      > >>-----Original Message-----
      > >>I am getting the following error: " Object reference[/color][/color]
      > not[color=green][color=darkred]
      > >>set to an instance of an object."
      > >>
      > >>The strange thing is that I AM creating a new instance[/color][/color]
      > of[color=green][color=darkred]
      > >>the object in the PageLoad event Iin the code behind)
      > >>just prior to using it's properties, and in fact, the[/color][/color]
      > app[color=green][color=darkred]
      > >>ran perfectly until only recently when I installed
      > >>Project Server on the web server, which should have had
      > >>no impact.
      > >>
      > >>Is there a security setting or something else that[/color][/color]
      > might[color=green][color=darkred]
      > >>compromise instantiating classes? I'm lost.
      > >>
      > >>
      > >>
      > >>.
      > >>[/color]
      > >.
      > >[/color][/color]


      Comment

      • Marty Cruise

        #4
        Re: Unexplained Instance Error

        Error still occurs...

        Comment

        • David Waz..

          #5
          Unexplained Instance Error

          try reading ALL posts to your answer and follow the
          recommendations given...

          [color=blue]
          >-----Original Message-----
          >I am getting the following error: " Object reference not
          >set to an instance of an object."
          >
          >The strange thing is that I AM creating a new instance of
          >the object in the PageLoad event Iin the code behind)
          >just prior to using it's properties, and in fact, the app
          >ran perfectly until only recently when I installed
          >Project Server on the web server, which should have had
          >no impact.
          >
          >Is there a security setting or something else that might
          >compromise instantiating classes? I'm lost.
          >
          >
          >
          >.
          >[/color]

          Comment

          Working...