null, list and generics

  • Thread starter Thread starter Vivek
  • Start date Start date
V

Vivek

Hi,

I am adding data to my list<T>. Som of my paramteres are "". When I try to
retreive them from the list I get a null exception error. How can I handle
null?

Thanks
 
Are you adding to a List<string>? By "" do you mean an empty string?

If the answer to both questions is yes, then you can load the whole
List<string> with empty strings if you want and you'll be able to
retrieve every one of them. There is probably something else wrong in
your code.

As with all questions like this please provide a short code sample
demonstrating the problem, and indicate the point at which you get the
null reference exception.

--Bob
 
Back
Top