Click or drag to resize

CommonEngineRecordsToDataTable Method (ICollection, Type, Int32)

Converts any collection of records to a DataTable using reflection. If the number of records is 0 this methods returns an empty DataTable with the columns based on the fields of the Type.

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

Parameters

records
Type: System.CollectionsICollection
The records to be converted to a DataTable
recordType
Type: SystemType
The type of the inner records.
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