Not sure if this is possible or not but I'd like to have an ExpandoObject (.Net 4.0) that I can add properties to without knowing the property name until runtime. I have tried a couple of things but have had no luck yet. Can I do this? Here's a failed attempt:
Any suggestions? Thanks!
Code:
dynamic _Item = new ExpandoObject(); foreach (DataRow r in dtIT.Rows) { //assign any matching column names to object properties foreach (DataColumn c in dtIT.Columns) { { _Item.c.ColumnName = r[c.ColumnName]; ...
Comment