I\'m using Rob Conery\'s Massive ORM, and I haven\'t been able to bind the resulting ExpandoObject to a GridView.
I did find another Stacko
adapting from Ben's answer
public static DataTable ToDataTable(this IEnumerable items)
{
if (!items.Any()) return null;
var table = new DataTable();
bool isFirst = true;
items.Cast>().ToList().ForEach(x =>
{
if (isFirst)
{
x.Keys.Select(y => table.Columns.Add(y)).ToList();
isFirst = false;
}
table.Rows.Add(x.Values.ToArray());
});
return table;
}