-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: VireshShah
Message 1 in Discussion

Hello friends,     I've some query regarding comparing object values. Consider 
following sample code.     Option Strict On
Option Explicit On

Public Class Person

Private _FirstName As String
Private _LastName As String
Private _DOB As Date

Public Property FirstName() As String
   Get
      Return _FirstName
   End Get
   Set (ByVal Value as String)
     _FirstName = Value
   End Set
End Property

Public Property LastName() As String
   Get
      Return _LastName
   End Get
   Set (ByVal Value as String)
     _LastName = Value
   End Set
End Property

Public Property
 DOB() As Date
   Get
      Return _DOB
   End Get
   Set (ByVal Value as Date)
     _DOB = Value
   End Set
End Property

End Class     Ok, so somewhere in my code, I create to Person objects, Bill  
and Joe.       Dim Person1 as New Person()
Person1.FirstName = "Bill"
Person1.LastName = "Jones"
Person1.DOB = "01/01/1980"

Dim Person2 as New Person()
Person2.FirstName = "Joe"
Person2.LastName = "Bills"
Person2.DOB = "01/01/1990"     Now I want to compare these two objects from 
their values. So it should return true if Preson1 and Person2 have same values 
in their properties (FirstName, LastName and DOB). How can I compare these two 
objects from their  values rather than its reference types?      Thanks in 
advance....Waiting for yr reply.    
 Viresh Shah     "Give the world the best you have"     
   

                 
Enjoy this Diwali with Y! India Click here

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to