an error message- Object reference not set to an instance of anobject.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Montezuma's Daughter

    #1

    an error message- Object reference not set to an instance of anobject.

    Hi all
    it is my first application. I wrote a class libraray with functions
    and a simple class with form, textbox, buttons and a label.
    I added reference to the second class so I would read the class
    library. the I met 2 problems:
    1.test data in the textbox is string and I need a double, how do I
    convert it?
    2.in default.cs I get en error message :
    =============== =============== =============== =========
    One or more errors encountered while loading the designer. The errors
    are listed below. Some errors can be fixed by rebuilding your project,
    while others may require code changes.

    Object reference not set to an instance of an object.
    Hide

    at
    Microsoft.Visua lStudio.Design. Serialization.C odeDom.MergedCo deDomParser.Sys tem.CodeDom.Com piler.ICodePars er.Parse(TextRe ader
    stream)
    at System.CodeDom. Compiler.CodeDo mProvider.Parse (TextReader
    codeStream)
    at
    Microsoft.Visua lStudio.Shell.D esign.Serializa tion.CodeDom.Co deDomDocDataAda pter.get_Compil eUnit()
    at
    Microsoft.Visua lStudio.Design. Serialization.C odeDom.VSCodeDo mDesignerLoader .PerformLoad(ID esignerSerializ ationManager
    serializationMa nager)
    at
    System.Componen tModel.Design.S erialization.Ba sicDesignerLoad er.BeginLoad(ID esignerLoaderHo st
    host)
  • Munna

    #2
    Re: an error message- Object reference not set to an instance of anobject.

    Hi,

    "Object reference not set to an instance of an object. "

    this error message is thrown when you try to use an uninitialized
    object...

    check your code ...

    Best of luck

    -------
    Munna




    Comment

    • Munna

      #3
      Re: an error message- Object reference not set to an instance of anobject.

      Hi

      "1.test data in the textbox is string and I need a double, how do I
      convert it? "

      double.Parse
      double.TryParse
      Convert.ToDoubl e

      use one of those function to convert string to double...

      check if use try tring to access any unassigned object...

      "Object reference not set to an instance of an object. " is occured
      when you try to access an unassigned object reference

      Best of luck

      -------
      Munna




      Comment

      • Montezuma's Daughter

        #4
        Re: an error message- Object reference not set to an instance of anobject.

        Gu there
        thanks. the conversation worked, thanks
        stll not sure what objwct I didn't uninitialized ? if I use class
        library I need to make an instance of it? or is it the text box?






        On Jul 19, 1:50 pm, Munna <munna...@gmail .comwrote:
        Hi,
        >
        "Object reference not set to an instance of an object. "
        >
        this error message is thrown when you try to use an uninitialized
        object...
        >
        check your code ...
        >
        Best of luck
        >
        -------
        Munna
        >
        https://www.munna.shatkotha.com/blog....shatkotha.com

        Comment

        • Munna

          #5
          Re: an error message- Object reference not set to an instance of anobject.

          Hi,

          The error i seeing is designer serialization errors... are u using any
          custom controls?
          well another question from my part... the errors are showing in design
          mode of the page ... right?
          when you done coding close the aspx page... then compile... and run
          the project....
          make sure you do close the page before u run the project...

          BEST OF LUCK

          --------------
          Munna




          Comment

          Working...