null, list and generics

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vivek

    #1

    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


  • Bob Grommes

    #2
    Re: null, list and generics

    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:[color=blue]
    > 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
    >
    >[/color]

    Comment

    Working...