I'm not sure if this is exactly what you are looking for, but it should work; exists . The extension method AsEnumerable () , which can then be used to project a string into a new entity.
var products = productTable.AsEnumerable().Select(row => new Product { ProductID = row.Field<int>("ProductID"), Name = row.Field<string>("Name"), CreatedDate = row.Field<DateTime>("CreatedDate") });
As far as I know, the .Field<T>() method does not perform any type conversion, so if there was no type set in the column, you will need to do the conversion yourself.
Adam flanagan
source share