Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Debug Error I Dont Understand

Status
Not open for further replies.

Sealbear

Programmer
Feb 1, 2006
3
US
Hello to any who take their time to read this.

I am a beginner programer and am currently using Visual Studio.NET 2003.

I built a very basic program and decided to test it. I ran the program with Debug activated.

I have a single form with two textboxes and an "Enter" button. The user enters a numeric variable into each textbox and then those variables are stored into an Array.

After entering values into each textbox and clicking on the "Enter" button the program gave me this error:


Code:
An unhandled exception of type 'System.NullReferenceException' occurred in MyProject.exe

Additional information: Object reference not set to an instance of an object.


I honestly do not understand what I am supposed to look for now to fix.

Thank you for your time and help!!!
 
Hello again,

I found out through someone else that I made an error in declaring my array.

My incorrect code was:
Code:
Dim arrayName() As Integer
So my error went away once I assigned how many elements were in the array as:
Code:
Dim arrayName(100) As Integer
Thanks for your interest in reading this though!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top