我想在中国做类似的事情.净3.5.最快的方法是什么?
IEnumerable<DataRow> collection =
TypedDataSet.TypedTableBase<DataRow>.Rows as IEnumerable<DataRow>;
我想在中国做类似的事情.净3.5.最快的方法是什么?
IEnumerable<DataRow> collection =
TypedDataSet.TypedTableBase<DataRow>.Rows as IEnumerable<DataRow>;
假设你正在使用.NET 4.0,它引入了协方差:
// Presumably your table is of some type deriving from TypedTableBase<T>,
// where T is an auto-generated type deriving from DataRow.
IEnumerable<DataRow> collection = myTypedTable;
table type itself实现了IEnumerable<T> where T : DataRow
.
否则:
IEnumerable<DataRow> collection = myTypedTable.Cast<DataRow>();