[Mono-devel-list] Returntype of System.Data.DataTable.Select

gerhard at ibrittweger.de gerhard at ibrittweger.de
Tue Apr 12 11:11:29 EDT 2005

I think there is an error in System.Data.DataTable.Select (IExpression filter, SortableColumn [] sortableColumns, DataViewRowState recordStates)

If you use a typed dataset with your own Datarow class derived from DataRow und
use an Select on your DataTable class derived from DataTable the select has to
return an array of your DataRows insteat of base-Class Datarows.

In DataTable.cs Line 1317
DataRow[] dataRows = (DataRow[])rowList.ToArray(typeof(DataRow));

typeof(DataRow) has to be replaced by GetRowType()

DataRow[] dataRows = (DataRow[])rowList.ToArray(GetRowType());

More information about the Mono-devel-list mailing list