Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
amir - 16 May 2008 13:25 GMT
do i have to remove the pair and then reinsert it or can i just update the
value of the dictionary
Paul E Collins - 16 May 2008 14:05 GMT
> 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 - 16 May 2008 14:25 GMT
what do you mean just update it? how do i update a value for a certain key?

> > do i have to remove the pair and then reinsert it or can i just update
> > the value of the dictionary
[quoted text clipped - 3 lines]
>
> Eq.
Family Tree Mike - 16 May 2008 14:30 GMT
Assuming that the key is in the dictionary,

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

> what do you mean just update it? how do i update a value for a certain key?
>
[quoted text clipped - 5 lines]
> >
> > Eq.
Cowboy (Gregory A. Beamer) - 16 May 2008 18:04 GMT
dictionary["KeyName"] = newValue;

Signature

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!

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.