473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How To Modify An Element in the Dictionary Class?

xarzu
88 64KB
How To Modify An Element in the Dictionary Class?
=======================================

C# has this cool Dictionary class that you can use like a Hash Table. Is there a way of changing the value of an indexed element without resorting to removing it like this?
Expand|Select|Wrap|Line Numbers
  1.                int value = runningcount[city];
  2.                runningcount.Remove(city);
  3.                runningcount.Add(city, ++value);
  4.  
  5.  
Aug 19 '12 #1
0 1180

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: eggie5 | last post by:
Hi, I'm trying to set the class of an element on my page w/ javascript like this: function ResetNavigation(element) { element.className = "active"; }
3
by: craigkenisston | last post by:
I want to use Dictionary class like this: textboxM.Text = oMyDict.GetValue("textboxM"); textboxN.Text = oMyDict.GetValue("textboxN"); Where my dictionary contains the list of values for my...
0
by: =?Utf-8?B?cm9zYW5h?= | last post by:
I have a xsd, schema get about a Microsoft tool using my own Database. I need modify in code the structure Keyref element, but don't add a standard item. I need add my own...
1
by: SpreadTooThin | last post by:
I have a dictionary that looks like: a0,b0,c0,d0,e0 a1,b1,c1,d1,e1 .... .... Currently I consider (Class Tag) to be the key and (Class Value) to be the value. However I now need to use ...
8
by: nagylzs | last post by:
Hi All, Can you show me an example of a working dictionary object that is portable? I would like to have something like: d = new PortableDict() d.setValue('a',12) d.setValue('b',-3)
0
by: Andy B | last post by:
How would you make an ajax update pannel show the key/value pair values inside a dictionary class? I need them in an html definition list if possible.
2
by: Andy B | last post by:
I have a dictionary class that I want to add key/value pairs to through a wizard. I want to have 2 text boxes and an add button inside the wizard. When a person fills in the 2 text boxes and...
1
by: GVDC | last post by:
Example server-side JavaScript Web script, Dictionary class //Dictionary class, hash array unlimited length configurable speed/efficiency // printf("<html><body>"); printf("<b>Creating...
8
by: Bob Altman | last post by:
Hi all, I'm trying to do something that should be really easy, but I can't think of an obvious way to do it. I have a dictionary whose value is a "value type" (as opposed to a reference type --...
2
by: uday1302 | last post by:
Hi, I have Listbox(lstgroups) and listview(lstItems). say items in lisbox as Groups and in listview as Items. Each Group should have list of items, when i add an new item to lstitems. it should...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.