I\'m trying to make some code more readable. For Example foreach(var row in table) {...} rather than foreach(DataRow row in table.Rows) {...}.
foreach(var row in table) {...}
foreach(DataRow row in table.Rows) {...}
some offtopic: if you want to do it more readable write
foreach ( DataRow r in tbl.Rows ) yield return r;
as
foreach (DataRow row in tbl.Rows) { yield return row; }
now to your problem.. try this
public static IEnumerable GetEnumerator(this DataTable table) { return table.Rows.Cast(); }