DataTableFillerFill Method |
Fills the specified datatable with the data from the datareader.
Namespace:
SD.LLBLGen.Pro.ORMSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.8.0.0 (5.8.21.0111)
Syntax public static void Fill(
IDataReader dataSource,
DataTable toFill,
IFieldPersistenceInfo[] fieldsPersistenceInfo,
IRetrievalQuery queryExecuted
)
Public Shared Sub Fill (
dataSource As IDataReader,
toFill As DataTable,
fieldsPersistenceInfo As IFieldPersistenceInfo(),
queryExecuted As IRetrievalQuery
)
Parameters
- dataSource
- Type: System.DataIDataReader
Data source. Is assumed the reader is at the first record, so Read() has been called. - toFill
- Type: System.DataDataTable
To fill. - fieldsPersistenceInfo
- Type: SD.LLBLGen.Pro.ORMSupportClassesIFieldPersistenceInfo
Fields persistence info. Keep in mind that these are for a single field. If the source is an expression, you can't rely on the
name for instance for this field as it's aliased in the resultset. - queryExecuted
- Type: SD.LLBLGen.Pro.ORMSupportClassesIRetrievalQuery
Query executed.
Remarks
DataReader isn't cleaned up afterwards. Call PersistenceCore.CleanupDataReader afterwards when you're done with the reader.
This method is called in multiple situations: when toFill has all the columns needed, when toFill has no columns, when the resultset has more or less columns than
required (e.g. stored proc resultset), and e.g. when everything matches perfectly. Therefore it has to check everything up front.
See Also