Matt: o in the end instead of _Item.c.descrip, I want to have _Item.descrip
Then stop making an _Item.c. layer. If you only want _Item.descrip then only make _Item.descrip Its your code that is generating that hierarchy.
- _Item.c.ColumnName = r[c.ColumnName];
Just because you have to reference the DataColumn C on the right side of the equasion doesn't force you to use it on the left.
If you want to do this, go right ahead
- _Item.descrip = r.Columns[2];]
Now the name doesn't matter, so long as the third column is the description.
But if you are trying to somehow magically map an unknown and changing number of columns with unknown and changing names, to known properties... I don't see a way you can always be certain. *Some* rules have to govern any system. You have to know either the names or their positions to be sure you are getting what you expect to get.
You could search for a column whose name starts with "Descrip", and match to anything from 'Descript" to "Description" so long as the start is right.