assuming we use this on a table using “select * from table ” ?
i want to create an array of classes
that use filed names (of the datatable) as class field names initalise them with the datatable
fields
is it possible ?
if so please help 🙂
soory for the spelling
my writen english is not that good
but i hope i was clear
This is a great time to use anonymous types
If you already have a class to store the results you could just as easily replace the anonymous type with that class (or use a Tuple in 4.0)
If you do this frequently you could write an extension method that uses reflection to match up data columns with the names of properties in the class array you are trying to generate