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

  • Thread starter Montezuma's Daughter
  • Start date
M

Montezuma's Daughter

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.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader
stream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader
codeStream)
at
Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
host)
 
M

Munna

Hi

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

double.Parse
double.TryParse
Convert.ToDouble

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

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
 
M

Montezuma's Daughter

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?
 
M

Munna

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

www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top