473,769 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

obsolete New Hashtable(New CaseInsensitive HashCodeProvide r, New CaseInsensitive Comparer), use IEqualityCompar er instead

New warning in .net 2.0... The cumbersome, and difficult to remember
case-insensitive comparer declaration for the hashtable has been
deprecated... It tells me to use IEqualityCompar er instead.

So, this syntax is obsolete:

New Hashtable(New CaseInsensitive HashCodeProvide r, New
CaseInsensitive Comparer)

So, the replacement seems to be (after an hour of searching):

New Hashtable(Strin gComparer.Ordin alIgnoreCase)
The following link is helpful as it describes the "why"... At least
this one will be easy to remember.

http://msdn.microsoft.com/library/de...ngsinNET20.asp
Example (vb.net):

Dim d As New Hashtable(Strin gComparer.Ordin alIgnoreCase)

d.Add("hello", "why do they make this so difficult?")

If d.ContainsKey(" HELLO") Then
MsgBox("because ")
End If
Hopefully this saves someone else an hour of searching...

Northern State - Is "Georgeous George" a liberal arts, academic,
literary kinda name? Right?

Nov 22 '05 #1
0 3889

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

Similar topics

1
3948
by: Samuel | last post by:
Hi, I used to have this with .NET 1.1: Dim objDict As Hashtable = New Hashtable(New CaseInsensitiveHashCodeProvider(), New CaseInsensitiveComparer()) but when I code the above statement in VS.NET 2005, a warning pops up with this message:
1
9944
by: _eee_ | last post by:
I'm looking for a way to step through a hashtable while adding items to the table (This precludes using enumerators. They don't like HashTable alterations while they are active). There must be an internal structure that can be accessed sequentially, like an array. Is it accessible? Or maybe there is another construct that will allow this. The main reason I'm using a HashTable is to eliminate duplicate entries. (This is why I had...
2
1281
by: A.M | last post by:
Hi, By default, HashTable.ContainsValue is case sesetive for string datatype. Can I have it non-casesensetive? Thanks Alan
1
7203
by: vertigo | last post by:
Hello I defined: Hashtable chan1 = new Hashtable(new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture), new InvariantComparer()); where: public class InvariantComparer : IComparer {
2
1674
by: Brian Keating | last post by:
hi there, has anyone had success in serializing a 2.0 case sensivite hashtable ie. private Hashtable m_itemsById = new Hashtable( new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer()); And deserializing it in 1.1? It doens't work, and a serialization exception is thrown indication that
5
7844
by: Dave | last post by:
Hi all, Is it possible to populate a listbox from a hashtable (complexbind) where the ValueMember of the listbox maps to the "key" member of the hashtable AND the DisplayMember of the listbox maps to the "value" member of the hashtable? I found that it is impossible to use a hashtable as a listbox datasource directly (from trial and error) and tried DirectCast-ing to an arraylist without any success. Before I spend anymore time in vain...
10
2101
by: Q | last post by:
Hi, I'm using a hashtable to store away a bunch of numbers from my array: The Hashtable should look like: Key Value 1 01234 2 01235
5
2903
by: rk2008 | last post by:
I am using Hashtable to keep Key-Value pair of elements. When I add the items to the Hashtable it does not retain the order in which I have added the key-value pair. Is there anyway to retain the order?
9
3117
by: raylopez99 | last post by:
Hello all— I’m trying to get the below to work and cannot get the format right. It’s from this example: http://msdn.microsoft.com/en-us/library/8627sbea(VS.71).aspx What it is: I’m trying to store multicast delegates in a hash table, and then fire the delegates one of two ways (after registering/ creating the delegates, etc).
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.