G
Guest
What is the best method to compare 2 array to knw if each element is equal?
Now, i have to compare the datarow.itemarray of 2 datarows wich is equals in
structure.
I tried to write this routine: (OPTION STRICT MUST BE ON!!)
Private Function ISArrayEquals(ByVal A As Array, ByVal B As Array) As
Boolean
For index As Integer = 0 To A.Length - 1
If A.GetValue(index) <> B.GetValue(index) Then '<----Here is the error!
Return False
End If
Next
End Function
But in the commented line i have to convert in the right type... but i don't
know HOW.
Obviously i assume the arrays are identical for type and dimension, i only
want to check values.
Anybody can help me in this routine or a better method ?
Thank you.
Now, i have to compare the datarow.itemarray of 2 datarows wich is equals in
structure.
I tried to write this routine: (OPTION STRICT MUST BE ON!!)
Private Function ISArrayEquals(ByVal A As Array, ByVal B As Array) As
Boolean
For index As Integer = 0 To A.Length - 1
If A.GetValue(index) <> B.GetValue(index) Then '<----Here is the error!
Return False
End If
Next
End Function
But in the commented line i have to convert in the right type... but i don't
know HOW.
Obviously i assume the arrays are identical for type and dimension, i only
want to check values.
Anybody can help me in this routine or a better method ?
Thank you.