MichiKen
New member
- Joined
- Feb 1, 2011
- Messages
- 1
- Programming Experience
- Beginner
I'm new to VB.NET. Just trying to run a basic program where the user is prompted to enter five names, one at a time. I'm prompted one time. After entering one name I get the following error "Unhandled exception: System.NullReferenceException:Object reference not set to an instance of an object"
Here's the code:
Here's the code:
VB.NET:
Module Module1
Sub Main()
Dim SortedList
For SortedList = 1 To 5
Console.WriteLine("Enter a favorite name (you'll be prompted 5 times): ")
SortedList = Console.ReadLine()
Next
Dim myItem As DictionaryEntry
For Each myItem In SortedList
Console.WriteLine(myItem.Value)
Next
End Sub
End Module