473,320 Members | 1,838 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,320 software developers and data experts.

type extraction and reflection

Hi

here is my class structure. U can say an object to hold data.

public class NameC_Base
{
private string _First;
private string _Last;

Internal inTes internalObj;

public NameC_Base()
{
internalObj = new inTes();
}

public string First
{
get { return _First; }
set

{ _First = value;

internalObj._FirstAgrg = "100";
}
}
public string Last
{
get { return _Last; }
set { _Last = value; }
}

}
public class inTes
{
public string _FirstAgrg;
public string _LastArg;
}
Now lets say i have two instance of the same class obj1, obj2, and i
like to compare the values against different fields and underline
objects to ensure they are same or different.

I am able to list out all the members
Type MyType = obj1.GetType();
MemberInfo[] Mymemberinfoarray =
MyType.GetMembers(BindingFlags.Instance | BindingFlags.Public |
BindingFlags.NonPublic | BindingFlags.Static);

am also able to list values with ((FieldInfo)item).GetValue(obj1)
BUT

How to list the members of "inTes" class or "internalObj" object and
their values?
its a kind of generalized object compare.

Is there any other way to compare objects and know the different
field values which are mismatching.

Thanks,
Prakash

Jul 27 '08 #1
0 799

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

Similar topics

8
by: Leszek Taratuta | last post by:
Hello, I have the following code: // Load the MenuBar.ascx user control. The control defines SavePropertyEvent event. UserControl ctrl =...
1
by: mrkurt | last post by:
I've built a few webservices locally that work just fine. Deployed them to a server and I get the following exception. This exception happens on even the most basic webmethod call. Hitting the...
10
by: Chris Morse | last post by:
Hi, I'm trying to figure out how to dynamically load an assembly and get an IClientPlugin interface to a class. I can get an "Object" reference to it after doing an "Activator.CreateInstance"...
0
by: qiang | last post by:
Hi everyone, Could you please take a look at an exception for ASP.NET application? My ASP.NET application is using Infragistics WebChart control. I encounter an exception below when...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
2
by: Angel Of Death | last post by:
I have a method. It takes some XML as a parameter. Depending on the content of the XML it should create a specific object and call a KNOWN method. So: public void PersistXml(string XmlData){} ...
7
by: Paul Hadfield | last post by:
Hi, I'm running into one problem with trying to call "Type.GetCustomAttributes(...)" on my reflected code. Basically - I can't trap my own custom attribute - I can only catch / identify system...
1
by: =?Utf-8?B?YW5kcmV3Y3c=?= | last post by:
base {System.SystemException} = {"Method may only be called on a Type for which Type.IsGenericParameter is true."} I have created a simple DLL. using System.Collections.Generic; using...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.