TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
scott griffin
NA
5
2.1k
Class with a List Add to list
Sep 27 2011 5:41 PM
Ok that subject was probably not the best in the world but this is what is going on.
I have some code that looks something like this.
public class CLASS
{
public string firstprop {get; set;}
public List<string> secondprop{get; set;}
}
now I could easily add a value to CLASS.firstprop = "mystring";
but when trying to add a value to CLASS.secondprop = "mystring"
it wont work I get a null exception.
I am trying to consume an xml file and fill the class with the data.
of course this is just thrown together code this is not what my code specifically looks like but it is close enough to get a good idea of what may be going wrong.
I am using a XMLReader to cycle through the XML file to get the data and it will get everything except it blows up when it gets to the list part
Reply
Answers (
5
)
NullReferenceException was unhandled by user code
Which key used to compile code line by line in vb.net?