Click or drag to resize

CommonEngineRecordsToDataTable Method (ICollection, Int32)

Converts any collection of records to a DataTable using reflection. WARNING: this methods returns null if the number of records is 0, pass the Type of the records to get an empty DataTable.

Namespace:  FileHelpers
Assembly:  FileHelpers (in FileHelpers.dll) Version: 3.2.6
Syntax
public static DataTable RecordsToDataTable(
	ICollection records,
	int maxRecords
)

Parameters

records
Type: System.CollectionsICollection
The records to be converted to a DataTable
maxRecords
Type: SystemInt32
The max number of records to add to the DataTable. -1 for all.

Return Value

Type: DataTable
The DataTable containing the records as DataRows
See Also