| | |
NullReferenceException Error
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 21
Reputation:
Solved Threads: 0
Hi Friends,
I am getting the following error with my code
"Object reference not set to instance of the object" .
My code goes as follows:
Please help!!
I am getting the following error with my code
"Object reference not set to instance of the object" .
My code goes as follows:
C# Syntax (Toggle Plain Text)
... ... string[] isem= new string[125]; decimal[] perc = new decimal[125]; student s1=new student(); ... ... public void func() { isem = new string[125]; perc = new decimal[125]; string[] temproll=new string[125]; int j=0; sem = s1.calcallperc1(..., ..., ....);//calcperc1 returns an array j=-1; foreach (string s in isem) { temproll[++j] = s.Split(' ')[0]; perc[j] = Convert.ToDecimal(s.Split(' ')[1]); } } ...
Please help!!
•
•
Join Date: Jun 2009
Posts: 67
Reputation:
Solved Threads: 0
•
•
•
•
Hi Friends,
I am getting the following error with my code
"Object reference not set to instance of the object" .
My code goes as follows:
C# Syntax (Toggle Plain Text)
... ... string[] isem= new string[125]; decimal[] perc = new decimal[125]; student s1=new student(); ... ... public void func() { isem = new string[125]; perc = new decimal[125]; string[] temproll=new string[125]; int j=0; sem = s1.calcallperc1(..., ..., ....);//calcperc1 returns an array j=-1; foreach (string s in isem) { temproll[++j] = s.Split(' ')[0]; perc[j] = Convert.ToDecimal(s.Split(' ')[1]); } } ...
Please help!!
sem = s1.calcallperc1(..., ..., ....);//calcperc1 returns an array
Either it should be isem or the sem should be declared as an array variable since the function returns the an array.
Hope this would be help you!!
![]() |
Similar Threads
- Error after uploading dlls (ASP.NET)
- 'Object variable or With block variable not set' Error (ASP.NET)
- NullReferenceException was unhandled (C#)
- system.NullReferenceException (C#)
- Unhandled Exception Error (VB.NET)
- Error connecting to database (ASP.NET)
- Error message when passing property changes between forms (VB.NET)
- c++ debugging error (C++)
Other Threads in the C# Forum
- Previous Thread: How to add rows from dataset to datagridview
- Next Thread: Modal Dialog Box
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combo combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees developer development draganddrop drawing encryption enum equation event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot math mathematics mouseclick mysql nargalax operator path photoshop picturebox pixelinversion post programming radians regex remote remoting restore richtextbox save saving serialization server sleep socket sql stack statistics stream string table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





