I\'m migrating our DAL class library to .NET 4 (from .NET 3.5). We\'re using typed datasets quite often, and we often iterate over tables:
foreach(var row in
All this is correct but in my case I had to support source code which needs to run with .Net 2.0 and .Net 4.0. My objective was to change as little code as possible.
My solution was to create a partial extension under .Net 4.0 and bind it to the 4.0 application. This looks like:
namespace NamespaceOfMyDataSet
{
public partial class MyDataSet : global::System.Data.DataSet
{
public partial class MyTypedTable : global::System.Data.TypedTableBase
{
public System.Data.DataRowCollection GetRows()
{
return this.Rows;
}
}
}
}
This works like a charme!!!