471,321 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

null, list and generics

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
Dec 25 '05 #1
1 1189
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

Vivek wrote:
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

Dec 26 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Cedric Rogers | last post: by
9 posts views Thread by =?Utf-8?B?UGV0ZXJX?= | last post: by
9 posts views Thread by Stephan Steiner | last post: by
1 post views Thread by tshad | last post: by
7 posts views Thread by =?Utf-8?B?TXJOb2JvZHk=?= | last post: by
11 posts views Thread by Scott Stark | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.