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
Syntaxpublic static DataTable RecordsToDataTable(
ICollection records,
int maxRecords
)
Public Shared Function RecordsToDataTable (
records As ICollection,
maxRecords As Integer
) As DataTable
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:
DataTableThe DataTable containing the records as DataRows
See Also