At runtime I'm getting two different arrays {object[10]} and I would like to check if the values in the first array are the same as those in the other. The actual types of the elements could be string, int or bool. For example element [1] = "Test" and element [2] = 3 and so on.
What I've done is this:
for (var j = 0; j < newData.ItemArray.Length; j++) { if (newData.ItemArray[j].ToString().ToLower() != originalData.ItemArray[j].ToString().ToLower()) { isModified = true; break; } } I can't say that I'm satisfied with this solution, however it seems to work judging by the few tests I made. However I feel that there should be a better way for doing this.
ADDITIONAL Judjing from the comments maybe I wasn't too clear in my question. This is what I get as input:
I expect the other array to contains the same data. The only problem is that all elements are stored as objects. So for example I would like to know if element [3] in the first array is like element [3] from the another array. Ideally I would like to compare two boolean values but since everything is stored as objects I'm looking for ideas how to check if the values are the same or for example from [1] = "Training" in the other array is [1] = "Not Training" and so on..

Object Equals(this Object object)method and compare each property.