Disclaimer: I know its asked at so many places at SO.
My query is a little different.
Coding Language: C# 3.5
I have a DataTable named cardsTable that
well its the one line solution
it depends on whether or not you know the data in the database is all valid and will not contain anything that will break the above
eg a nullable field whenre you dont expect it - maybe due to a left join int eh sql that genertates the data.
So if you have validated the data before then yeah - I was goign to suggest some linq - but you got tht down.
If you need some validation however you should probably just loop through the datarows, generate your object as above and add it to the collection ... this will also allow you to handle errors in one row and still process the rest.
Thats the way i see it anyway
(damn i came on to downvote something so my rep was 1024)