tags:

views:

142

answers:

2

Hi all, I am tryin to add data to my list object.
For a string, I just say, this.name = myDaraReader["test"]toTring(); How do I go about doing that for a list?

A: 
List<string> nameList = new List<string>();
nameList.Add(myDaraReader["test"]toTring());

//Note: I just added what you typed above instead of fixing the syntax.

Here are a few links for reading on the two topics List and DataReader

Billy
+2  A: 

Maybe there is more to this than I see but is there a reason you can't just write

theList.Add(myDataReader["test"].toString());

I think that will work unless I am missing something..