First step, make cAddress objects comparable. Basically, this means to
implement the IComparable interface (that is, define a CompareTo method for
it). You may also wnat to define an operator== for it.
Next, I'm going to assume that Current
corresponds to Database, in
which case it, it's just:
for(int i =0; i< Current.Length, ++i)
{
cAddress ad1 = Current;
cAddress ad2 = Database;
if (ad1.CompareTo(ad2) != 0)
return "Don't Match";
}
return "Match";
--
--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Gaby said:
Hi,
I need to compare 2 array lists with the same object type (cAddress).
public class cAddress
{
public string Address = "";
public string Number = "";
public string Zip = "";
public string City = "";
public string Country = "";
public string Telephone = "";
}
Every period the data from the database will be checked against the current
arraylist.
The lists will be filled with aprox 10000 objects.
No I want to know what the best and quickest way is.
Gaby