ContainsKey with Custom Dictionary Keys

G

Guest

I'm using VB in ASP.NET 2.0. I've created a dictionary with a custom key
that contains 2 integers as properties. The key is in the dictionary, but
when I do a ContainsKey(mykey) it always returns false. This works if the
key in the dictionary is just a single integer.

I a C# forum I found a reference to overriding an objects GetHashCode.
Because the ContainsKey. Anyone have an example of how to do this? Is this
the right approach?

thanks,

Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top