T
Tony Johansson
Hi!
If you for example have a StringDictionary and you add by using key as index
like this
stringdictionaryInstance["myKey"] = "myValue1"
stringdictionaryInstance["myKey"] = "myValue2"
and have identical keys as I have in this example only the last one is added
which is ok.
If I now add by using the add method instead as I do here
stringdictionaryInstance.Add("myKey", "myValue1")
stringdictionaryInstance.Add("myKey", "myValue2")
I get exeption because of identical keys.
So my first question is why does it behave differently ?
I mean in the last example when I used the add only the last one would have
been added is it is with the first example
It's also behave differently when I use the NameValueCollection beween
adding using
the add method and when I add in this way
NameValueCollectioninstanc["Key"] = "Some Text"
NameValueCollectioninstanc["Key"] = "Some more Text"
It behave as it it documented but I just wonder why behave differently ?
//Tony
//Tony
If you for example have a StringDictionary and you add by using key as index
like this
stringdictionaryInstance["myKey"] = "myValue1"
stringdictionaryInstance["myKey"] = "myValue2"
and have identical keys as I have in this example only the last one is added
which is ok.
If I now add by using the add method instead as I do here
stringdictionaryInstance.Add("myKey", "myValue1")
stringdictionaryInstance.Add("myKey", "myValue2")
I get exeption because of identical keys.
So my first question is why does it behave differently ?
I mean in the last example when I used the add only the last one would have
been added is it is with the first example
It's also behave differently when I use the NameValueCollection beween
adding using
the add method and when I add in this way
NameValueCollectioninstanc["Key"] = "Some Text"
NameValueCollectioninstanc["Key"] = "Some more Text"
It behave as it it documented but I just wonder why behave differently ?
//Tony
//Tony