468,321 Members | 1,825 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

StringCollection[]

Dan
Hi,

Is it possible to iterate through a StringCollection[] ? I have the
following code but "row" always seems to contain the values of rowValues2

Thanks for any input,

Danny

StringCollection[] scArray = new StringCollection[]{rowValues1, rowValues2};

foreach (StringCollection row in scArray) //Does not seem to work for a
StringCollection[]

{

}
Nov 16 '05 #1
2 2145
Dan <da***@hotmail.com> wrote:
Is it possible to iterate through a StringCollection[] ? I have the
following code but "row" always seems to contain the values of rowValues2


That suggests that you've made an error in the rest of your code.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hi Dan,

Try this code:

foreach (StringCollection row in scArray)
{
foreach(string str in row)
MessageBox.Show (str);
}

Regards,
Peter

"Dan" <da***@hotmail.com> wrote in message
news:cb**********@avnika.corp.mot.com...
Hi,

Is it possible to iterate through a StringCollection[] ? I have the
following code but "row" always seems to contain the values of rowValues2

Thanks for any input,

Danny

StringCollection[] scArray = new StringCollection[]{rowValues1, rowValues2};
foreach (StringCollection row in scArray) //Does not seem to work for a
StringCollection[]

{

}

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Oschler | last post: by
3 posts views Thread by Jonathan | last post: by
2 posts views Thread by Dennis Myrén | last post: by
3 posts views Thread by Ben Fidge | last post: by
1 post views Thread by Juan Francisco Figueroa Perez | last post: by
8 posts views Thread by Naz | last post: by
reply views Thread by Dinesh Rathi | last post: by
2 posts views Thread by =?Utf-8?B?YmlsbCB0aWU=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.