Multiple Keys

  • Thread starter Thread starter shahid.juma
  • Start date Start date
S

shahid.juma

Using NameValueCollection, is this possible:

my.Add ("1", "VALUE");
my.Add ("1", "VALUE");
my.Add ("2", "VALUE");
my.Add ("2", "VALUE");

Also, how do I iterate through it and print the values that have been
stored.

Thanks in advance,
Shahid
 
Yes, you can use repeating key values in a NameValueCollection. When you
retrieve the values, they will be in a comma separated list format

I'm not sure if there is another way to get the values but here's one
method:

foreach(string key in my.Keys)
{
string item = my[key];
}

I hope this helps.

Jon
 
Back
Top