472,958 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

StringDictionary vs Dictionary<>

Hi

are there any benefits in using StringDictionary over Dictionary<string,
string?

It appears they achieve the same thing... (I could be wrong of course).
thanks,
Peter
May 24 '07 #1
4 10627
On May 24, 10:31 am, Peter K <xdz...@hotmail.comwrote:
are there any benefits in using StringDictionary over Dictionary<string,
string?

It appears they achieve the same thing... (I could be wrong of course).
The only benefit would be that you could compile your code in .NET
1.1, which didn't have generics (and thus didn't have
Dictionary<TKey,TValue>).

Jon

May 24 '07 #2
"Peter K" <xd****@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
are there any benefits in using StringDictionary over Dictionary<string,
string?
Not in my opinion - in fact...
It appears they achieve the same thing... (I could be wrong of course).
....you need to be *very* careful with StringDictionary:
http://forums.microsoft.com/MSDN/Sho...05992&SiteID=1

If you're running v2, I would advise you not use StringDictionary at all...
--
http://www.markrae.net

May 24 '07 #3
"Peter K" <xd****@hotmail.comschrieb im Newsbeitrag
news:e0**************@TK2MSFTNGP06.phx.gbl...
Hi

are there any benefits in using StringDictionary over Dictionary<string,
string?
StringDictionary compares the keys always case insensitive by converting any
string to lower case before use.
This may be disirable or not.

Christof
May 24 '07 #4
On May 24, 11:06 am, "Christof Nordiek" <c...@nospam.dewrote:
are there any benefits in using StringDictionary over Dictionary<string,
string?

StringDictionary compares the keys always case insensitive by converting any
string to lower case before use.
This may be disirable or not.
One alternative for Dictionary<to achieve the case insensitivity but
preserving the case of the keys themselves is to specify the
IEqualityComparer to use.

The MSDN docs for Dictionary<TKey,TValue>(IEqualityComparer<TKey>) has
this has an example.

Jon

May 24 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ESPNSTI | last post by:
Hi, I'm trying to use a generics dictionary with a key class that implements and needs IComparable<>. However when I attempt to use the dictionary, it doesn't appear to use the IComparable<> to...
8
by: Brian P | last post by:
I want to expose a property of Dictionary<string, MyAbstractClass>. I tried to do it this way: private Dictionary<string, MyChildClass> _dictionary; public Dictionary<string,...
1
by: Eran | last post by:
Hi, I have a huge data structure, which I previosly stored in a Dictionary<int, MyObj> MyObj is relatively small (2 int, 1 DateTime, 1 bool). The dictionary I am using is quite large...
7
by: Andrew Robinson | last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v> depending on input parameters and options to the method. 1. Is there any way to convert from a dictionary to a list...
4
by: Mark S. | last post by:
Hello, I have a series of changing string IDs that are loaded dynamically a couple times a minute. I need to associate each ID with a different static class so later on in the app's lifecycle it...
8
by: Peter Larsen [CPH] | last post by:
Hi, How do i concat two dictionaries aka the following sample: Dictionary<int, stringa; Dictionary<int, stringb; b.Add(a); What is the easiest way to concat two dictionaries ??
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.