I am porting our DAL class library to .NET 4 (from .NET 3.5). We often use typed datasets, and we often repeat tables:
foreach(var row in ds.MyTable) var tmp = row.ID;
This does not work anymore, since the constructor changes the code of the data set, so that the tables are no longer derived from TypedTableBase<T> , but from DataTable (and implement a non-generic IEnumerable ). What diff shows. Therefore, the string is of type object at compile time.
Does anyone know if this is normal behavior? At the moment, I am doing this as shown below, but I hope there will be a more elegant solution:
foreach(var row in ds.MyTable.Cast<MyDs.MyRow>()) var tmp = row.ID;
source share