473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 2361
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Oschler | last post by:
What is the Python equivalent of the C# StringCollection container? I'm trying to port some C# code over to Python. Thanks. Robert
3
by: Jonathan | last post by:
I tried using Type::GetType on S"System.Collections.Specialized.StringCollection", but it returned NULL. The only way it worked was when I used the fully qualified name, including the assembly...
2
by: Dennis Myrén | last post by:
Hi. I want to know why it is not possible to specify (or determine) the capacity for a System.Collections.Specialized.StringCollection. I guess the StringCollection would be the better choice...
3
by: Ben Fidge | last post by:
Hi What are the options for sorting a StringCollection? I'm quite surprised that StringCollection doesn't have any sorting capability built in! Thanks Ben
1
by: Juan Francisco Figueroa Perez | last post by:
Hi all: I have a StringCollection property like this: public class FormExito : Form { ................ ................ private StringCollection FEditar;
8
by: Naz | last post by:
Hi, I am new in C# and converting a program from delphi to C#. I have to store a list of strings in memory and also need to save the strings to disk at the end. I use StringCollection and my...
0
by: Dinesh Rathi | last post by:
Hi I have a managed dll which I am using in my unmanaged application through its com interfaces. Now can I use StringCollection/ String class through com interfaces ? One of my class has a member...
2
by: eSapient | last post by:
I have a case where a C# dll is being consumed by an unmanaged C++ executable. One of the dll methods returns a StringCollection object. What are the requirements for the C++ executable in terms of...
2
by: =?Utf-8?B?YmlsbCB0aWU=?= | last post by:
Why should I use StringCollection as opposed to List<string>? Thank you.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.