Questions tagged [idictionary]

System.Collections.IDictionary and System.Collections.Generic.IDictionary interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

System.Collections.IDictionary and System.Collections.Generic.IDictionary<TKey, TValue>interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

MSDN links:

148 questions
0
votes
2 answers

Why Trie DataStructure when Dictionary Class can be used for string count from large files

Suppose I need to count words from a very large file ( words are split by " " ) I would do following Not load entire file in memory , read stream line by line. For each line Split words and add distinct word to "dictionary" ( I mean, use Dictionary…
Sunil Vurity
  • 830
  • 9
  • 14
0
votes
0 answers

How to filter Generic Dictionary items by using different object fields?

I need to implement a repository class that can let user search on different field of an object. After retrieve data from another service, I save the result to a Dictionary object, now I want to able filter result based on different object's…
longlifelearner
  • 195
  • 1
  • 10
0
votes
0 answers

Idictionary as a source of SQL insert into

I created Sql Update procedure using c# dynamic object ( here it is 'string,string' dictionary - 'sql_fields_name,value_to_insert' ) which works well. public static string sp_UpdateDB(int ID, dynamic a, string procName, string connString)// update…
greko
  • 225
  • 2
  • 6
0
votes
1 answer

Include Dictionary in anonymous type and then serialize to form json

In the following code, I have a dictionary "nissi_params_fields" which I have populated with parameters: Dictionary nissi_params_fields = new Dictionary(); string[] separator = { "," }; string[] dfields =…
bolaji
  • 51
  • 5
0
votes
2 answers

Dictionary within another dictionary + Multiple values for one key

I want to do a dictionary which contains another dictionary. And I want that my dictionary have multiple values for only one key but I get a error : "An element with the same key already exists". I already did it in JAVA with HashMap and it's ok but…
trainor
  • 21
  • 2
0
votes
2 answers

WPF Cannot Bind Dependancy Property From Custom UserControl

I have MultiSelectComboBox UserControl inside my Custom UserControl. I'd like to bind the SelectedItems Dependency Property (from the MSCB above) which is type of Dictionary to any of My ViewModel Property... *MSBC means --> MultiSelectComboBox…
0
votes
1 answer

Cannot merge dict into masterDict without null reference

It seams simple enough but I cannot append values into my master dictionary. I think this is because the dict has an object elements instead of just a simple type and I don't have the syntax correct on "masterDict.Add" method. I know some of my…
Bill
  • 915
  • 2
  • 13
  • 23
0
votes
4 answers

How to convert to a dictionary from a dictionary value

I have a dictionary which holds another dictionary within the value. i.e.: Dictionary primaryList = new Dictionary(); var secondaryList = primaryList.Select(x => x.Value); I need to get the value as a dictionary in…
NewBie
  • 1,824
  • 8
  • 35
  • 66
0
votes
3 answers

Dictionary of dictionaries, how to get value?

I have something like this: private IDictionary> data; and I want to do something like: IDictionary values = new Dictionary(); values = Data.Values; like would I do in java, but this isn't working. I can't figure…
Miloš Lukačka
  • 842
  • 1
  • 11
  • 25
0
votes
4 answers

Sorting IDictionary Generic

I need to know if there is any way of ordering an IDictionary without knowing what type it is exactly ... For example, I have a method that received an object and within this I have a Dictionary object ... all I know is that it is a Dictionary so I…
Maicon
  • 51
  • 10
0
votes
1 answer

Splitting value items in a dictionary

I asked a similar question before but am just asking it from a slightly different angle. I have a list of codes and underneath each code I have a bunch of values that are taken from the fields Subject and GenSubject. Problem is these…
Arianule
  • 8,811
  • 45
  • 116
  • 174
0
votes
6 answers

Deleting a key in a dictionary

How would I go about in deleting a specified key within a Dictionary based on the following condition? foreach (var kvp in dict) { if (kvp.Key.Contains('/')) { //delete the key …
Arianule
  • 8,811
  • 45
  • 116
  • 174
0
votes
2 answers

Splitting the key values in a dictionary

I have several keys (which represents subjects) in a dictionary and with that I associate several values(codes) per key. CODE SUBJECT 7DIM-039 Communication 7DIM-040 Communication 7DIM-041 Communication 7DIM-042 Communication 7DIM-043…
Arianule
  • 8,811
  • 45
  • 116
  • 174
0
votes
3 answers

adding List values to a dictionary

I am trying to populate a dictionary of which the subject value which is unique have various Code values that should be matched with it. CODE SUBJECT 7DIM-062 Recruitment and Selection 7DIM-063 Recruitment and Selection 7DIM-064 …
Arianule
  • 8,811
  • 45
  • 116
  • 174
0
votes
3 answers

How to cast IDictionary to IDictionary

I'm using the default MemoryCache, which works fine for my purposes. However the GetValues() method returns IDictionary Is there a quick way to cast this to IDictionary ?
BlueChippy
  • 5,935
  • 16
  • 81
  • 131
1 2 3
9
10