I'm getting this:
private object setReportValues(object report, FormCollection values)
{
PropertyInfo[] properties = report.GetType().GetProperties();
foreach (PropertyInfo property in properties)
{
string val = values.GetValue(property.Name).ToString();
property.SetValue(report, val, null);
}
return report;
}
Exception is on string val = values.GetValue(property.Name).ToString();. Do I have to check for nulls before?
values? What isreport? Why are you using reflection?