?
Solved

c# Compare two dictionaries

Posted on 2010-09-02
1
Medium Priority
?
2,671 Views
Last Modified: 2012-08-13
Hi

I have two dictionary object variables
I want to know if they are different or not. I expect them to be totally alike but I want to have a fast check.
What is the fastest way to compare these two dictionaries. I would prefer not having to loop through them

any ideas?
0
Comment
Question by:liversen
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 33586014
You can't directly compare the list & the dictionary, but you could compare the list of values from the Dictionary with the list

http://msdn.microsoft.com/en-us/library/bb342073.aspx 

Enumerable.SequenceEqual

Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer(T).

found at: http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month16 days, 23 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question