
I’m calling a web service that is returning this object. I know I should be using object reflection in C# to access the property of sentBatchTotal. However, I can’t for the life of me figure out how to get to this property. I have looked at several other articles here and on MSDN but it’s just not sinking in.
Here is my code, what am I doing wrong?
private void button1_Click(object sender, EventArgs e)
{
prdChal.finfunctions service = new prdChal.finfunctions();
//Type thisObject = typeof()
//Type myType = myObject.GetType();
//IList<PropertyInfo> props = new List<PropertyInfo>(myType.GetProperties());
String ThisName = "";
Object StatusReturn = new Object();
StatusReturn = service.UpdateGrantBillStatus(fundBox.Text, toBox.Text, fromBox.Text);
var type = StatusReturn.GetType();
var propertyName = type.Name;
//var propertyValue = propertyName.GetValue(myObject, null);error here
}
1 Answer