Comparing 2 arrays, what's the fastest way ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! I am trying to determine if the DataRow of one dataset contains the same
data as the DataRow of another. I figured I can extract ItemArray's from each
dataset and then compare them.

1) Is this the fastest way? I will have to loop through thousands of rows
for what I am doing.

2) How can I compare arrays for Value Equality ? I do not think array's
..Equal method does Value Equality check. Based on what I understood, it does
Reference Equality check. Am I right ?


Any input is greatly appreciated,
 
Mike said:
Hi! I am trying to determine if the DataRow of one dataset contains the same
data as the DataRow of another. I figured I can extract ItemArray's from each
dataset and then compare them.

1) Is this the fastest way? I will have to loop through thousands of rows
for what I am doing.

I don't know whether it's worth using ItemArray rather than just
accessing each column in turn - you should benchmark both cases.
2) How can I compare arrays for Value Equality ? I do not think array's
.Equal method does Value Equality check. Based on what I understood, it does
Reference Equality check. Am I right ?

Yes.
 
Back
Top