V
Vagif Abilov
When I use AppSettings and try to retrieve multiple values associated with a
single key, I only get the last value. E.g. if I have in my config
<appSettings>
<add key="Key" value="Value1" />
<add key="Key" value="Value2" />
</appSettings>
then attempt to read both values by using AppSettings.GetValues("Key") gives
only "Value2".
This is not what's written in .NET Framework documentation which says:
"NameValueCollection collection is based on the NameObjectCollectionBase
class. However, unlike the NameObjectCollectionBase, this class stores
multiple string values under a single key."
And the whole purpose og GetValues is to retrieve multiple values, ulike an
indexer that only returns a single value. It does return a string array, but
only with a single value.
What can be wrong?
Vagif Abilov
vagif @ online.no
single key, I only get the last value. E.g. if I have in my config
<appSettings>
<add key="Key" value="Value1" />
<add key="Key" value="Value2" />
</appSettings>
then attempt to read both values by using AppSettings.GetValues("Key") gives
only "Value2".
This is not what's written in .NET Framework documentation which says:
"NameValueCollection collection is based on the NameObjectCollectionBase
class. However, unlike the NameObjectCollectionBase, this class stores
multiple string values under a single key."
And the whole purpose og GetValues is to retrieve multiple values, ulike an
indexer that only returns a single value. It does return a string array, but
only with a single value.
What can be wrong?
Vagif Abilov
vagif @ online.no