I'm looking for some help implementing an issue i have.
main purpose is aggregating information from DB
I get data from a DB, and that table has 2 primary keys.
for each pair (primary key) i create an object that holds all the information, and after all the DB is read, i take each object and put its information in a differnet DB table.
I need to clarify that performance is very important, dealing with about 1milion rows every time.
The issue im having is how to hold that info. I tried using a Dictionary, the key being Pair
however, when using Dictinary.contains() didnt recognize 2 similar Pairs, and created a new 'similar' object instead of returning the one already existing.
I am not sure if I should implement Icomparable,
or maybe there is a different way altogether that might be better.
Thanks for your help
Sam HobbsPosted Mar 27, 2010, 1:53 AM
ediPosted Mar 26, 2010, 6:23 PM
ediPosted Mar 26, 2010, 5:24 PM
The pair (object that has 2 fields: first, second), and one method: 'public override bool Equals(object obj){}'
the key of the dictionary, are enum values.
the value of the dictionary, is an object.
defined (like you described) Dictionary
why shouldn't this work?
Sam HobbsPosted Mar 26, 2010, 4:50 PM
Dictionary
Or something else? If you used a Pair object as the key, then it makes sense to me that that would not work.
Also, what are the data types of the two primary keys? Are they both string or something else?