I have an strongly typed DataTable of type MyType, I\'d like convert it in a List.
How can I do this ?
Thanks.
Assuming your DataRows inherit from your own type, say MyDataRowType, this should work:
List list = new List();
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.