473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Reflection issue

I have a routine that compares 2 intances of the same object to see if there are any changes. The problem is that even though there are no changes, it tells me there are. I have even tried running a new routine that shows a messagebox with both objects' property values. below is my code.
this is the actual comparison code:
Dim Properties() As PropertyInfo = pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
If ischanged = False Then

With PropertyItem
Dim o1 As New Object''These are just for testing and will be returned to refactored code
Dim o2 As New Object''These are just for testing and will be returned to refactored code
o1 = .GetValue(obj, Nothing)''These are just for testing and will be returned to refactored code
o2 = .GetValue(obj_original, Nothing)''These are just for testing and will be returned to refactored code
'TODO Comment These Out
Debug.WriteLine(String.Format("Property Name: {0} PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
Debug.WriteLine(String.Format(" Name {0}", .Name))
Debug.WriteLine(String.Format(" New Value {0}", o1))
Debug.WriteLine(String.Format("Original Value {0}", o2))
'Debug.WriteLine(String.Format(" isChanged {0}", ischanged.ToString))
Debug.WriteLine(Environment.NewLine)
If Not o1.Equals(o2) Then

ischanged = True
End If
End With
End If
Next

This is the code that I validate with first: it displays the information properly.

Private Shared Sub validateValues(ByVal obj As Object, ByVal obj_original As Object, ByVal ptype As Type)
Dim s As New StringBuilder

Dim Properties() As PropertyInfo = ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
s.AppendFormat("Property Name:{0} CurrentValue:{1} OriginalValue:{1}", .Name, .GetValue(obj, Nothing), ..GetValue(obj_original, Nothing))
s.Append(Environment.NewLine)

End With
Next
MessageBox.Show(s.ToString)

End Sub
--
--Eric Cathell, MCSA
Nov 21 '05 #1
6 1185
That's because the line:

If Not o1.Equals(o2) Then
ischanged = True
End If

is checking for reference equality, and not value equality. For example:

Dim myObj1 As Object = New Object()
Dim myObj2 As Object = New Object()

'Will return false because the references point to different object
MessageBox.Show(myObj1.Equals(myObj2))

myObj1 = myObj2

'Will return true because the references point to the same object
MessageBox.Show(myObj1.Equals(myObj2))

"ECathell" wrote:
I have a routine that compares 2 intances of the same object to see if there are any changes. The problem is that even though there are no changes, it tells me there are. I have even tried running a new routine that shows a messagebox with both objects' property values. below is my code.
this is the actual comparison code:
Dim Properties() As PropertyInfo = pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
If ischanged = False Then

With PropertyItem
Dim o1 As New Object''These are just for testing and will be returned to refactored code
Dim o2 As New Object''These are just for testing and will be returned to refactored code
o1 = .GetValue(obj, Nothing)''These are just for testing and will be returned to refactored code
o2 = .GetValue(obj_original, Nothing)''These are just for testing and will be returned to refactored code
'TODO Comment These Out
Debug.WriteLine(String.Format("Property Name: {0} PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
Debug.WriteLine(String.Format(" Name {0}", .Name))
Debug.WriteLine(String.Format(" New Value {0}", o1))
Debug.WriteLine(String.Format("Original Value {0}", o2))
'Debug.WriteLine(String.Format(" isChanged {0}", ischanged.ToString))
Debug.WriteLine(Environment.NewLine)
If Not o1.Equals(o2) Then

ischanged = True
End If
End With
End If
Next

This is the code that I validate with first: it displays the information properly.

Private Shared Sub validateValues(ByVal obj As Object, ByVal obj_original As Object, ByVal ptype As Type)
Dim s As New StringBuilder

Dim Properties() As PropertyInfo = ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
s.AppendFormat("Property Name:{0} CurrentValue:{1} OriginalValue:{1}", .Name, .GetValue(obj, Nothing), ..GetValue(obj_original, Nothing))
s.Append(Environment.NewLine)

End With
Next
MessageBox.Show(s.ToString)

End Sub
--
--Eric Cathell, MCSA

Nov 21 '05 #2
That's because the line:

If Not o1.Equals(o2) Then
ischanged = True
End If

is checking for reference equality, and not value equality. For example:

Dim myObj1 As Object = New Object()
Dim myObj2 As Object = New Object()

'Will return false because the references point to different object
MessageBox.Show(myObj1.Equals(myObj2))

myObj1 = myObj2

'Will return true because the references point to the same object
MessageBox.Show(myObj1.Equals(myObj2))

"ECathell" wrote:
I have a routine that compares 2 intances of the same object to see if there are any changes. The problem is that even though there are no changes, it tells me there are. I have even tried running a new routine that shows a messagebox with both objects' property values. below is my code.
this is the actual comparison code:
Dim Properties() As PropertyInfo = pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
If ischanged = False Then

With PropertyItem
Dim o1 As New Object''These are just for testing and will be returned to refactored code
Dim o2 As New Object''These are just for testing and will be returned to refactored code
o1 = .GetValue(obj, Nothing)''These are just for testing and will be returned to refactored code
o2 = .GetValue(obj_original, Nothing)''These are just for testing and will be returned to refactored code
'TODO Comment These Out
Debug.WriteLine(String.Format("Property Name: {0} PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
Debug.WriteLine(String.Format(" Name {0}", .Name))
Debug.WriteLine(String.Format(" New Value {0}", o1))
Debug.WriteLine(String.Format("Original Value {0}", o2))
'Debug.WriteLine(String.Format(" isChanged {0}", ischanged.ToString))
Debug.WriteLine(Environment.NewLine)
If Not o1.Equals(o2) Then

ischanged = True
End If
End With
End If
Next

This is the code that I validate with first: it displays the information properly.

Private Shared Sub validateValues(ByVal obj As Object, ByVal obj_original As Object, ByVal ptype As Type)
Dim s As New StringBuilder

Dim Properties() As PropertyInfo = ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
s.AppendFormat("Property Name:{0} CurrentValue:{1} OriginalValue:{1}", .Name, .GetValue(obj, Nothing), ..GetValue(obj_original, Nothing))
s.Append(Environment.NewLine)

End With
Next
MessageBox.Show(s.ToString)

End Sub
--
--Eric Cathell, MCSA

Nov 21 '05 #3
So then how do i check for value equality?

--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:D1**********************************@microsof t.com...
That's because the line:

If Not o1.Equals(o2) Then
ischanged = True
End If

is checking for reference equality, and not value equality. For example:

Dim myObj1 As Object = New Object()
Dim myObj2 As Object = New Object()

'Will return false because the references point to different object
MessageBox.Show(myObj1.Equals(myObj2))

myObj1 = myObj2

'Will return true because the references point to the same object
MessageBox.Show(myObj1.Equals(myObj2))

"ECathell" wrote:
I have a routine that compares 2 intances of the same object to see if
there are any changes. The problem is that even though there are no
changes, it tells me there are. I have even tried running a new routine
that shows a messagebox with both objects' property values. below is my
code.
this is the actual comparison code:
Dim Properties() As PropertyInfo =
pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
If ischanged = False Then

With PropertyItem
Dim o1 As New Object''These are just for testing and will be
returned to refactored code
Dim o2 As New Object''These are just for testing and will be
returned to refactored code
o1 = .GetValue(obj, Nothing)''These are just for testing and
will be returned to refactored code
o2 = .GetValue(obj_original, Nothing)''These are just for
testing and will be returned to refactored code
'TODO Comment These Out
Debug.WriteLine(String.Format("Property Name: {0}
PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
Debug.WriteLine(String.Format(" Name {0}", .Name))
Debug.WriteLine(String.Format(" New Value {0}", o1))
Debug.WriteLine(String.Format("Original Value {0}", o2))
'Debug.WriteLine(String.Format(" isChanged {0}",
ischanged.ToString))
Debug.WriteLine(Environment.NewLine)
If Not o1.Equals(o2) Then

ischanged = True
End If
End With
End If
Next

This is the code that I validate with first: it displays the information
properly.

Private Shared Sub validateValues(ByVal obj As Object, ByVal obj_original
As Object, ByVal ptype As Type)
Dim s As New StringBuilder

Dim Properties() As PropertyInfo =
ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
s.AppendFormat("Property Name:{0} CurrentValue:{1}
OriginalValue:{1}", .Name, .GetValue(obj, Nothing),
..GetValue(obj_original, Nothing))
s.Append(Environment.NewLine)

End With
Next
MessageBox.Show(s.ToString)

End Sub
--
--Eric Cathell, MCSA

Nov 21 '05 #4
Honestly, that depends on what the underlying type actually is. The Equals()
method in System.Object checks for reference equality. However, in a lot of
reference types derived from System.Object, the actual type overrides the
Equals() method to check for value equality (like System.String).

What are the System.Type values are you expecting on these properties? You
can try casting them to those specified types and then checking the values
using that types Equals() method (assuming it checks for value equality).

"ECathell" wrote:
So then how do i check for value equality?

--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:D1**********************************@microsof t.com...
That's because the line:

If Not o1.Equals(o2) Then
ischanged = True
End If

is checking for reference equality, and not value equality. For example:

Dim myObj1 As Object = New Object()
Dim myObj2 As Object = New Object()

'Will return false because the references point to different object
MessageBox.Show(myObj1.Equals(myObj2))

myObj1 = myObj2

'Will return true because the references point to the same object
MessageBox.Show(myObj1.Equals(myObj2))

"ECathell" wrote:
I have a routine that compares 2 intances of the same object to see if
there are any changes. The problem is that even though there are no
changes, it tells me there are. I have even tried running a new routine
that shows a messagebox with both objects' property values. below is my
code.
this is the actual comparison code:
Dim Properties() As PropertyInfo =
pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
If ischanged = False Then

With PropertyItem
Dim o1 As New Object''These are just for testing and will be
returned to refactored code
Dim o2 As New Object''These are just for testing and will be
returned to refactored code
o1 = .GetValue(obj, Nothing)''These are just for testing and
will be returned to refactored code
o2 = .GetValue(obj_original, Nothing)''These are just for
testing and will be returned to refactored code
'TODO Comment These Out
Debug.WriteLine(String.Format("Property Name: {0}
PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
Debug.WriteLine(String.Format(" Name {0}", .Name))
Debug.WriteLine(String.Format(" New Value {0}", o1))
Debug.WriteLine(String.Format("Original Value {0}", o2))
'Debug.WriteLine(String.Format(" isChanged {0}",
ischanged.ToString))
Debug.WriteLine(Environment.NewLine)
If Not o1.Equals(o2) Then

ischanged = True
End If
End With
End If
Next

This is the code that I validate with first: it displays the information
properly.

Private Shared Sub validateValues(ByVal obj As Object, ByVal obj_original
As Object, ByVal ptype As Type)
Dim s As New StringBuilder

Dim Properties() As PropertyInfo =
ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
s.AppendFormat("Property Name:{0} CurrentValue:{1}
OriginalValue:{1}", .Name, .GetValue(obj, Nothing),
..GetValue(obj_original, Nothing))
s.Append(Environment.NewLine)

End With
Next
MessageBox.Show(s.ToString)

End Sub
--
--Eric Cathell, MCSA


Nov 21 '05 #5
I am using reflection to view the property values of a custom class. The
strange thing is on my non-complex objects this already works fine. It is
just on this class for now.All my classes have an abstract base and a
concrete class. However, this class has enumerations attached. Maybe that is
where my error is because my other classes dont do this...
Region "PrePack Enumeration"
Public Enum PrePackTypes
ICEPACK
TRAYPACK
End Enum
' Private mPrepack As Boolean
Private xPrepack As PrePackTypes
Public Shadows Property Prepack() As PrePackTypes
Get
Select Case MyBase.PrePack
Case True
xPrepack = PrePackTypes.TRAYPACK
Case False
xPrepack = PrePackTypes.ICEPACK

End Select

Return xPrepack
End Get
Set(ByVal Value As PrePackTypes)

xPrepack = Value
Select Case xPrepack
Case PrePackTypes.ICEPACK
MyBase.PrePack = False
Case PrePackTypes.TRAYPACK
MyBase.PrePack = True
End Select
End Set
End Property
#End Region

#Region "TareType Enumeration"
Public Enum TareTypes
STANDARD
PERCENTAGE
End Enum

'Private mTareType As Boolean
Private xTaretype As TareTypes
Public Shadows Property TareType() As TareTypes
Get
Select Case MyBase.TareType
Case True
xTaretype = TareTypes.PERCENTAGE
Case False
xTaretype = TareTypes.STANDARD
End Select
Return xTaretype

End Get
Set(ByVal Value As TareTypes)
xTaretype = Value
Select Case xTaretype
Case TareTypes.PERCENTAGE
MyBase.TareType = True
Case TareTypes.STANDARD
MyBase.TareType = False
End Select
End Set
End Property
'
#End Region

#Region "StorageTypes Enumeration"
Public Enum StorageTypes
REFRIGERATED
FROZEN
End Enum
'Private mStorage As String
Private xStorage As StorageTypes
Public Shadows Property Storage() As StorageTypes

Get
Select Case mStorage
Case "REFRIGERATED"
xStorage = StorageTypes.REFRIGERATED
Case "FROZEN"
xStorage = StorageTypes.FROZEN
End Select

Return xStorage

End Get
Set(ByVal Value As StorageTypes)
xStorage = Value
Select Case xStorage
Case StorageTypes.FROZEN
mStorage = "FROZEN"
Case StorageTypes.REFRIGERATED
mStorage = "REFRIGERATED"
End Select

End Set
End Property
#End Region

#Region "DateTypes Enumeration"
Public Enum DateTypes
[code]
[PACKED]
[SELL_BY]
[JULIAN]
End Enum

'Private mDateType As String
Private xDateType As DateTypes
Public Shadows Property DateType() As DateTypes
Get
Select Case mDateType
Case "CODE"
xDateType = DateTypes.CODE
Case "SELL-BY"
xDateType = DateTypes.SELL_BY
Case "PACKED"
xDateType = DateTypes.PACKED
Case "JULIAN"
xDateType = DateTypes.JULIAN

End Select
Return xDateType

End Get
Set(ByVal Value As DateTypes)
xDateType = Value
Select Case xDateType
Case DateTypes.CODE
mDateType = "CODE"
Case DateTypes.PACKED
mDateType = "PACKED"
Case DateTypes.SELL_BY
mDateType = "SELL-BY"
Case DateTypes.JULIAN
mdatetype = "JULIAN"
End Select

End Set
End Property
#End Region

#Region "WeightTypes Enumeration"
Public Enum WeightTypes
[FIXED]
[CATCH]
[KEYED]
End Enum
'Private mWeightType As String
Private xWeightType As WeightTypes
Public Shadows Property WeightType() As WeightTypes
Get

Select Case mWeightType
Case "FIXED"
xWeightType = WeightTypes.FIXED

Case "CATCH"
xWeightType = WeightTypes.CATCH

Case "KEYED"
xWeightType = WeightTypes.KEYED

End Select

Return xWeightType

End Get
Set(ByVal Value As WeightTypes)
xWeightType = Value
Select Case xWeightType
Case WeightTypes.CATCH
mWeightType = "CATCH"
Case WeightTypes.FIXED
mWeightType = "FIXED"
Case WeightTypes.KEYED
mWeightType = "KEYED"
End Select

End Set
End Property
'
#End Region

--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:BB**********************************@microsof t.com...
Honestly, that depends on what the underlying type actually is. The
Equals()
method in System.Object checks for reference equality. However, in a lot
of
reference types derived from System.Object, the actual type overrides the
Equals() method to check for value equality (like System.String).

What are the System.Type values are you expecting on these properties?
You
can try casting them to those specified types and then checking the values
using that types Equals() method (assuming it checks for value equality).

"ECathell" wrote:
So then how do i check for value equality?

--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:D1**********************************@microsof t.com...
> That's because the line:
>
> If Not o1.Equals(o2) Then
> ischanged = True
> End If
>
> is checking for reference equality, and not value equality. For
> example:
>
> Dim myObj1 As Object = New Object()
> Dim myObj2 As Object = New Object()
>
> 'Will return false because the references point to different object
> MessageBox.Show(myObj1.Equals(myObj2))
>
> myObj1 = myObj2
>
> 'Will return true because the references point to the same object
> MessageBox.Show(myObj1.Equals(myObj2))
>
> "ECathell" wrote:
>
>> I have a routine that compares 2 intances of the same object to see if
>> there are any changes. The problem is that even though there are no
>> changes, it tells me there are. I have even tried running a new
>> routine
>> that shows a messagebox with both objects' property values. below is
>> my
>> code.
>>
>>
>> this is the actual comparison code:
>> Dim Properties() As PropertyInfo =
>> pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
>> Dim PropertyItem As PropertyInfo
>> For Each PropertyItem In Properties
>> If ischanged = False Then
>>
>> With PropertyItem
>> Dim o1 As New Object''These are just for testing and will
>> be
>> returned to refactored code
>> Dim o2 As New Object''These are just for testing and will
>> be
>> returned to refactored code
>> o1 = .GetValue(obj, Nothing)''These are just for testing
>> and
>> will be returned to refactored code
>> o2 = .GetValue(obj_original, Nothing)''These are just for
>> testing and will be returned to refactored code
>> 'TODO Comment These Out
>> Debug.WriteLine(String.Format("Property Name: {0}
>> PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
>> Debug.WriteLine(String.Format(" Name {0}",
>> .Name))
>> Debug.WriteLine(String.Format(" New Value {0}", o1))
>> Debug.WriteLine(String.Format("Original Value {0}", o2))
>> 'Debug.WriteLine(String.Format(" isChanged {0}",
>> ischanged.ToString))
>> Debug.WriteLine(Environment.NewLine)
>> If Not o1.Equals(o2) Then
>>
>> ischanged = True
>> End If
>>
>>
>> End With
>> End If
>> Next
>>
>> This is the code that I validate with first: it displays the
>> information
>> properly.
>>
>> Private Shared Sub validateValues(ByVal obj As Object, ByVal
>> obj_original
>> As Object, ByVal ptype As Type)
>> Dim s As New StringBuilder
>>
>> Dim Properties() As PropertyInfo =
>> ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
>> Dim PropertyItem As PropertyInfo
>> For Each PropertyItem In Properties
>> With PropertyItem
>> s.AppendFormat("Property Name:{0} CurrentValue:{1}
>> OriginalValue:{1}", .Name, .GetValue(obj, Nothing),
>> ..GetValue(obj_original, Nothing))
>> s.Append(Environment.NewLine)
>>
>> End With
>> Next
>> MessageBox.Show(s.ToString)
>>
>> End Sub
>> --
>> --Eric Cathell, MCSA


Nov 21 '05 #6
I fixed it...I think it had an issue with my shadows properties...changed
their name and voila....

Thanks for the help....
--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:BB**********************************@microsof t.com...
Honestly, that depends on what the underlying type actually is. The
Equals()
method in System.Object checks for reference equality. However, in a lot
of
reference types derived from System.Object, the actual type overrides the
Equals() method to check for value equality (like System.String).

What are the System.Type values are you expecting on these properties?
You
can try casting them to those specified types and then checking the values
using that types Equals() method (assuming it checks for value equality).

"ECathell" wrote:
So then how do i check for value equality?

--
--Eric Cathell, MCSA
"rmacias" <rm*****@newsgroup.nospam> wrote in message
news:D1**********************************@microsof t.com...
> That's because the line:
>
> If Not o1.Equals(o2) Then
> ischanged = True
> End If
>
> is checking for reference equality, and not value equality. For
> example:
>
> Dim myObj1 As Object = New Object()
> Dim myObj2 As Object = New Object()
>
> 'Will return false because the references point to different object
> MessageBox.Show(myObj1.Equals(myObj2))
>
> myObj1 = myObj2
>
> 'Will return true because the references point to the same object
> MessageBox.Show(myObj1.Equals(myObj2))
>
> "ECathell" wrote:
>
>> I have a routine that compares 2 intances of the same object to see if
>> there are any changes. The problem is that even though there are no
>> changes, it tells me there are. I have even tried running a new
>> routine
>> that shows a messagebox with both objects' property values. below is
>> my
>> code.
>>
>>
>> this is the actual comparison code:
>> Dim Properties() As PropertyInfo =
>> pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
>> Dim PropertyItem As PropertyInfo
>> For Each PropertyItem In Properties
>> If ischanged = False Then
>>
>> With PropertyItem
>> Dim o1 As New Object''These are just for testing and will
>> be
>> returned to refactored code
>> Dim o2 As New Object''These are just for testing and will
>> be
>> returned to refactored code
>> o1 = .GetValue(obj, Nothing)''These are just for testing
>> and
>> will be returned to refactored code
>> o2 = .GetValue(obj_original, Nothing)''These are just for
>> testing and will be returned to refactored code
>> 'TODO Comment These Out
>> Debug.WriteLine(String.Format("Property Name: {0}
>> PropertyType:{1}", PropertyItem.Name, PropertyItem.PropertyType))
>> Debug.WriteLine(String.Format(" Name {0}",
>> .Name))
>> Debug.WriteLine(String.Format(" New Value {0}", o1))
>> Debug.WriteLine(String.Format("Original Value {0}", o2))
>> 'Debug.WriteLine(String.Format(" isChanged {0}",
>> ischanged.ToString))
>> Debug.WriteLine(Environment.NewLine)
>> If Not o1.Equals(o2) Then
>>
>> ischanged = True
>> End If
>>
>>
>> End With
>> End If
>> Next
>>
>> This is the code that I validate with first: it displays the
>> information
>> properly.
>>
>> Private Shared Sub validateValues(ByVal obj As Object, ByVal
>> obj_original
>> As Object, ByVal ptype As Type)
>> Dim s As New StringBuilder
>>
>> Dim Properties() As PropertyInfo =
>> ptype.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
>> Dim PropertyItem As PropertyInfo
>> For Each PropertyItem In Properties
>> With PropertyItem
>> s.AppendFormat("Property Name:{0} CurrentValue:{1}
>> OriginalValue:{1}", .Name, .GetValue(obj, Nothing),
>> ..GetValue(obj_original, Nothing))
>> s.Append(Environment.NewLine)
>>
>> End With
>> Next
>> MessageBox.Show(s.ToString)
>>
>> End Sub
>> --
>> --Eric Cathell, MCSA


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: maf | last post by:
Using reflection, I'm trying to get the value for a constant in an enum. Getting the contant name works fine using: FieldInfo fieldInfos = TYPE.GetFields(); foreach(FieldInfo fi in fieldInfos...
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
2
by: Jeff | last post by:
I am trying to dynamically load an assembly via reflection and then invoke a method of that assembly that will populate a custom type collection passed into the method byref. I am able to...
3
by: HL | last post by:
The requirement is to send some information to other objects. The objects to whom the information has to be sent is not available at compile time. The names of the types (objects) will be provided...
20
by: Shawnk | last post by:
I would like to get the class INSTANCE name (not type name) of an 'object'. I can get the object (l_obj_ref.GetType()) and then get the (l_obj_typ.Name) for the class name. I there any way of...
2
by: Wiktor Zychla [C# MVP] | last post by:
Could anyone confirm/deny that following is a bug (or at least an "unexpected behaviour")? If this is not a bug, I would be glad for a short explanation or a workaround. Issue: A generic...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
2
by: =?Utf-8?B?UmVuYXVkIExhbmdpcw==?= | last post by:
Hello, I have an asp.net web page (say page.aspx) which derives from a custom base page object (CustomPage : BasePage : System.Web.UI.Page) Which has a method called DoSomething(params). My web...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
11
by: idoublepress | last post by:
Hi all, I've been struggling with an issue that I hope you can comment on or provide suggestions to. Our .NET 2.0 (VS2005) based product is crashing (when the user selects a particular feature on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.