vi M

vi M

  • NA
  • 509
  • 0

comparing values in 2 Hash tables

Apr 5 2010 10:46 AM
Hello everyone!
I'm trying to compare values in 2 hash tables based on the same keys. So for example, I have a set a as follows:
hashtable1 (123, "apple"), hashtable1(234, "tree"), etc.
hashtable2 (123, "orange"), hashtable2(234, "tree")
So I need to loop through all the items in both hashtables, and compare the values, whenever the values are different, I need to print them out. And then, if the number of items is different, for example, hashtable1 has a couple of more keys, that are not in hashtable2, I need to print out what's different.  I'm pretty new to C#, and cannot seem to quite find the syntax on how to do it.  I'd appreciate any help. thank you!

Answers (8)