Unexplained Instance Error

Discussion in 'ASP .Net' started by Marty Cruise, Jul 3, 2003.

  1. Marty Cruise

    Marty Cruise Guest

    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.
     
    Marty Cruise, Jul 3, 2003
    #1
    1. Advertising

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

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.

    "Marty Cruise" <> wrote in message
    news:03ce01c34195$f3a168c0$...
    > 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, Jul 3, 2003
    #2
    1. Advertising

  3. I'm not sure why you're not getting an error on the following line:

    > Public myOrder As New cOrder


    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
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.


    "Marty Cruise" <> wrote in message
    news:09ea01c3419d$eeef31b0$...
    > Here is the relevant code. The error occurs when the
    > myOrder.getInfo method is called:
    >
    > =============================
    > Imports cLib
    >
    > Public Class frmPrintTR
    > Inherits System.Web.UI.Page
    > Public myOrder As New cOrder
    > Protected WithEvents lblShipTo As
    > System.Web.UI.WebControls.Label
    > Protected WithEvents Button1 As
    > System.Web.UI.WebControls.Button
    > Protected WithEvents Button2 As
    > System.Web.UI.WebControls.Button
    > Protected WithEvents btnPrint As
    > System.Web.UI.WebControls.Button
    > Protected WithEvents btnClose As
    > System.Web.UI.WebControls.Button
    > Protected WithEvents pDesiredVendor As
    > System.Web.UI.WebControls.Panel
    > Protected WithEvents pComments As
    > System.Web.UI.WebControls.Panel
    > Protected WithEvents pCommentsNone As
    > System.Web.UI.WebControls.Panel
    > Protected WithEvents pItemsNone As
    > System.Web.UI.WebControls.Panel
    > Protected WithEvents repItems As
    > System.Web.UI.WebControls.Repeater
    >
    > ' # Region stuff omitted from this posting
    >
    > Private Sub Page_Load(ByVal sender As Object, ByVal e
    > As System.EventArgs) Handles MyBase.Load
    > If Request.QueryString("TRID") = "" Then
    > Exit Sub
    > End If
    >
    > myOrder.GetInfo(CInt(Request.QueryString("TRID")))
    > repComments.DataSource = myOrder.Comments
    > repComments.DataBind()
    >
    > =============================
    >
    >
    > >-----Original Message-----
    > >Check your assumptions:
    > >
    > >if your control is actually there, does the
    > >property/method you use reference yet another control

    > that
    > >is not there?
    > >
    > >Are there other objects referenced on the offending

    > line?
    > >and finally, have you used the debugger and stepped into
    > >the routine causing the problem and checked the object
    > >variables in question?
    > >
    > >>-----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.
    > >>
    > >>
    > >>
    > >>.
    > >>

    > >.
    > >
     
    Kevin Spencer, Jul 3, 2003
    #3
  4. Marty Cruise

    Marty Cruise Guest

    Error still occurs...
     
    Marty Cruise, Jul 3, 2003
    #4
  5. Marty Cruise

    David Waz.. Guest

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


    >-----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.
    >
    >
    >
    >.
    >
     
    David Waz.., Jul 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michiel

    NEWBIE:unexplained syntax error

    Michiel, Sep 9, 2004, in forum: Perl
    Replies:
    2
    Views:
    507
    Barry Kimelman
    Sep 10, 2004
  2. Replies:
    2
    Views:
    475
  3. Nathan Sokalski

    Unexplained error when databinding

    Nathan Sokalski, Aug 25, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    2,179
    John Horst
    Aug 26, 2005
  4. =?Utf-8?B?am9uZWZlcg==?=

    Sudden unexplained IE validation error

    =?Utf-8?B?am9uZWZlcg==?=, Feb 5, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    368
    =?Utf-8?B?am9uZWZlcg==?=
    Feb 5, 2007
  5. Nathan Sokalski

    Unexplained error when databinding

    Nathan Sokalski, Aug 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    168
Loading...

Share This Page