Hai all...
Consider a sample database like this
Source IP Protocol
204.71.200.244 LLC
135.8.60.182 LOOP
204.71.200.244 LLC
172.16.115.5 LLC
each value i am getting as an abject using Dataset datatable concepts...
if i compare object
source1=204.71.200.244 and object source3= 204.71.200.244
I am getting a false value.....
Similarly for
object proto3=LLC and object proto4=LLC...
Help me please.....
Object Comparison.....
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Guest UserRank #1,422 · 1.2K reputationPosted Dec 15, 2008, 12:03 PM EST
You need to use something like object1.ToString().Equals(object3.ToString()).
Posted Dec 15, 2008, 6:59 PM EST
Guest UserRank #1,422 · 1.2K reputationPosted Dec 16, 2008, 5:19 AM EST
In your example, object1 will never be equal to object3 because they are referring to two different data objects, even though their contents are the same. In my example, the "ToString()" methods return the string equivalent of each object, and then I use the "Equals()" method to compare them.
If you're new to OOP, then the difference between objects and values can sometimes be a difficult concept to grasp, but keep at it! You'll get it soon enough.