Assuming your DataRow
s inherit from your own type, say MyDataRowType
, this should work:
List<MyDataRowType> list = new List<MyDataRowType>();
foreach(DataRow row in dataTable.Rows)
{
list.Add((MyDataRowType)row);
}
This is assuming, as you said in a comment, that you're using .NET 2.0 and don't have access to the LINQ extension methods.