Click here to Skip to main content
15,896,557 members

Comments by carterlist (Top 1 by date)

carterlist 22-Dec-10 6:44am View    
Deleted
Great job James. I had the same problem.
Here's a C# version adapted from another developer's solutn.


foreach(var p in linqQueryResult)
{
foreach (var curPropertyInfo in p.GetType().GetProperties())
{
MethodInfo getMeth = curPropertyInfo.GetGetMethod();
MethodInfo getSet = curPropertyInfo.GetSetMethod();

if ((getMeth == null) || (getSet == null))
continue;

if (string.Compare(curPropertyInfo.Name, "Item") != 0) // handle non-enumerable properties
{
object oValue = getMeth.Invoke(p, null);
string value = oValue.ToString();
Debug.WriteLine(curPropertyInfo.Name + ": " + value.ToString());
}
else // handle enumerable properties
{
}
}
}