Linked Questions

32 votes
6 answers
70k views

Possible Duplicate: Duplicate keys in .NET dictionaries? I need to create a Collection<string,object>, one is a string and another one is an object. I cannot use Dictionary since none of ...
eugeneK's user avatar
  • 11.2k
1 vote
2 answers
136 views

Possible Duplicate: Duplicate keys in .NET dictionaries? I want to use a kind of dictionary which can support duplicated keys. Is there any builtin support in .Net framework?
user496949's user avatar
  • 86.6k
38 votes
5 answers
38k views

I have a method that returns groups of technicians who have worked on certain projects, for example: project 1 | John project 1 | Tim project 2 | John project 2 | Dave I originally tried to create a ...
AdamMc331's user avatar
  • 16.7k
30 votes
6 answers
103k views

I have some lines from text files that i want to add into the Dictionary.I am using Dictionary for the first time.While adding up starting lines it was Ok but suddenly i got error: An item with the ...
Ram's user avatar
  • 565
23 votes
7 answers
27k views

Possible Duplicate: C# Sortable collection which allows duplicate keys Basically I'd like to make a Dictionary work with duplicate keys without going into custom comparer implementations. There is ...
Sedat Kapanoglu's user avatar
12 votes
6 answers
20k views

I have a need for a fairly specialised collection .NET, and I don't think that the BCL can help me, but I thought I'd throw it out there for if anyone knew of something similar. Basically, my ...
Matthew Scharley's user avatar
8 votes
7 answers
22k views

I want to store data such as { {"apple",15 } {"pear",12.5 } {"", 10 } {"", 0.45 } } Data will be plotted on a bar chart (string will be the ...
frenchone's user avatar
  • 1,617
7 votes
3 answers
8k views

A problem I often run into is needing to store a collection of objects in such a way that I can retrieve them by a particular field/property that is a unique "index" for that object. For example, I ...
Edward's user avatar
  • 6,360
3 votes
1 answer
6k views

I need the Key/Value stuff from a Dictionary. What I do not need is that it does not allow duplicate Keys. Regex template = new Regex(@"\{(?<key>.+?)\}(?<value>[^{}]*)"); IDictionary<...
msfanboy's user avatar
  • 5,311
0 votes
1 answer
8k views

I am new to vb.net. I want to create a key value pair or an array which ever is possible from a dynamic loop. The key name can have multiple entries I want output in following manner. I tried with ...
ritesh khadka's user avatar
1 vote
2 answers
3k views

I need an alternate for a dictionary, because duplicates are needed. The reason for that is: I need to search for the best route. To do that I am creating a population with 20 individuals for example....
Meliss's user avatar
  • 153
1 vote
1 answer
3k views

I am creating a json string by serializing an object in C# (using Newtonsoft) to pass to a third party charting library, so have no control over the structure I need to create. The structure requires ...
Nick's user avatar
  • 191
-5 votes
2 answers
1k views

Here is the sample i need to form. I tried hash set it is showing as key and value but i need my output to be in the below format. [{ "data": "Name" }, { "data": "Description" }] My sample ...
Eliotjse's user avatar
  • 119
0 votes
2 answers
1k views

I have a csv file with repetitive keys and multiple values from a csv. I have successfully parsed every row of csv in C# My csv file looks like this eid,hr ABC,25 ABC,35 FDG,50 LMN,61 Task1 I would ...
exd-AS's user avatar
  • 23
-4 votes
1 answer
816 views

I have Dictionary like this below. The key is names like cups, pens, tape, glasses, and rocks. The values will be classes that contain things such as amount, types, images, etc. The value is from the ...
1026's user avatar
  • 1

15 30 50 per page