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. Advertising

  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. Advertising

  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. 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. MyBase.Load

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

    MyBase versus Me

    shapper, Nov 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    382
    Karl Seguin [MVP]
    Nov 8, 2006
  3. =?Utf-8?B?TWlrZQ==?=
    Replies:
    0
    Views:
    639
    =?Utf-8?B?TWlrZQ==?=
    Jun 6, 2007
  4. tesis
    Replies:
    0
    Views:
    452
    tesis
    Jun 16, 2009
  5. Replies:
    2
    Views:
    448
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page