G
Guest
Hi,
Class1 will be instantiated for each "region".
Class2 will do the instantiation as it reads through records in a database.
In Class2 I need to create and use the information in an instance of Class1.
As I read a record with a new "region" I need to instantiate a new Class1.
If I read a record with a "region" I've already seen, I'll need to update the
appropriate member of Class1.
I was thinking that I might create a DictionaryEntry in Class2 to hold the
instances of Class1, but I'm not sure how to do that. Alternatively I could
create ArrayList1 to hold the instances and also an ArrayList2 with just the
"regions". Then I could use ArrayList2.IndexOf to find which member of the
ArrayList1.
I'm guessing that this is a common activity and someone can tell me the best
way to do this.
Thanks,
Art
Class1 will be instantiated for each "region".
Class2 will do the instantiation as it reads through records in a database.
In Class2 I need to create and use the information in an instance of Class1.
As I read a record with a new "region" I need to instantiate a new Class1.
If I read a record with a "region" I've already seen, I'll need to update the
appropriate member of Class1.
I was thinking that I might create a DictionaryEntry in Class2 to hold the
instances of Class1, but I'm not sure how to do that. Alternatively I could
create ArrayList1 to hold the instances and also an ArrayList2 with just the
"regions". Then I could use ArrayList2.IndexOf to find which member of the
ArrayList1.
I'm guessing that this is a common activity and someone can tell me the best
way to do this.
Thanks,
Art