Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to update a value in a Dictionary<K, V>

1 view
Skip to first unread message

amir

unread,
May 16, 2008, 8:25:01 AM5/16/08
to
do i have to remove the pair and then reinsert it or can i just update the
value of the dictionary

Paul E Collins

unread,
May 16, 2008, 9:05:15 AM5/16/08
to
"amir" <am...@discussions.microsoft.com> wrote:

> do i have to remove the pair and then reinsert it or can i just update
> the value of the dictionary

Just update it. A dictionary can only have one value stored per unique
key.

Eq.


amir

unread,
May 16, 2008, 9:25:04 AM5/16/08
to
what do you mean just update it? how do i update a value for a certain key?

Family Tree Mike

unread,
May 16, 2008, 9:30:00 AM5/16/08
to
Assuming that the key is in the dictionary,

MyDictionary ["MyCertainKey"] = "Some new value...";

Cowboy (Gregory A. Beamer)

unread,
May 16, 2008, 1:04:20 PM5/16/08
to
dictionary["KeyName"] = newValue;

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"amir" <am...@discussions.microsoft.com> wrote in message
news:7856B68C-D2E1-4E45...@microsoft.com...

0 new messages