NullReferenceException with MyBase.New()

Discussion in 'ASP .Net' started by =?Utf-8?B?ZGF2ZQ==?=, Dec 21, 2005.

  1. I have an object employee that is derived from person object. In .net 1.1 the
    following procedure worked without any problem. In 2.0 i get the
    nullreferenceexceptionerror. What could be going on here?

    public class employee
    inherits person

    public sub new(info as string)
    mybase.new(info) <<<<<<<<<<<<nullreferenceexception was unhandled by user
    code (object reference not set to an instance of an object)
    end sub

    thx
    dave
     
    =?Utf-8?B?ZGF2ZQ==?=, Dec 21, 2005
    #1
    1. Advertisements

  2. =?Utf-8?B?ZGF2ZQ==?=

    Karl Seguin Guest

    I don't believe there's anything wrong with your syntax.

    Clearly there's simply a nullreference exception in your base constructor.

    perhaps info is null? it's impossible to tell what else the problem could
    be without knowing what the New(info as string) constructor of Person is.



    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "dave" <> wrote in message
    news:...
    >I have an object employee that is derived from person object. In .net 1.1
    >the
    > following procedure worked without any problem. In 2.0 i get the
    > nullreferenceexceptionerror. What could be going on here?
    >
    > public class employee
    > inherits person
    >
    > public sub new(info as string)
    > mybase.new(info) <<<<<<<<<<<<nullreferenceexception was unhandled by user
    > code (object reference not set to an instance of an object)
    > end sub
    >
    > thx
    > dave
     
    Karl Seguin, Dec 21, 2005
    #2
    1. Advertisements

  3. Thank you Karl for your fast feedback.

    Yes, you were right the base class (dll) had errors in it.

    ty
     
    =?Utf-8?B?ZGF2ZQ==?=, Dec 22, 2005
    #3
  4. =?Utf-8?B?ZGF2ZQ==?=

    bhawin13 Guest

    Dave

    Checkout base constructor and argument that you pass to clild
    constructor (info).

    B
     
    bhawin13, Dec 22, 2005
    #4
    1. Advertisements

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. Fabio Papa
    Replies:
    1
    Views:
    674
    Jim Blizzard [MSFT]
    Sep 24, 2003
  2. William
    Replies:
    0
    Views:
    2,134
    William
    Aug 10, 2004
  3. msnews.microsoft.com

    Help with System.NullReferenceException

    msnews.microsoft.com, Jul 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    729
    msnews.microsoft.com
    Jul 16, 2003
  4. MyBase.Load

    , Oct 8, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,167
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Oct 8, 2006
  5. shapper

    MyBase versus Me

    shapper, Nov 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    504
    Karl Seguin [MVP]
    Nov 8, 2006
  6. =?Utf-8?B?TWlrZQ==?=
    Replies:
    0
    Views:
    881
    =?Utf-8?B?TWlrZQ==?=
    Jun 6, 2007
  7. tesis
    Replies:
    0
    Views:
    588
    tesis
    Jun 16, 2009
  8. Replies:
    2
    Views:
    795
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...