CommonEngineRecordsToDataTable Method (ICollection, Type) |
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
Syntaxpublic static DataTable RecordsToDataTable(
ICollection records,
Type recordType
)
Public Shared Function RecordsToDataTable (
records As ICollection,
recordType As Type
) As DataTable
Parameters
- records
- Type: System.CollectionsICollection
The records to be converted to a DataTable - recordType
- Type: SystemType
The type of the inner records.
Return Value
Type:
DataTableThe DataTable containing the records as DataRows
See Also