I use some code to execute SQL and return IEnumerable from dynamic objects. The code is here if you want to see it.
I have a table with a column name, for example APPLICATION_NAME;
In my object, I have to reference it like this:
var results = ReturnResults("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=rawdb;Data Source=mypc", "SELECT * FROM APPLICATIONS"); string name = results.First().APPLICATION_NAME;
Is there a way to get property names to solve something more neat? i.e.
string name = results.First().ApplicationName;
thanks
source share