Version

ReadObject(IDataReader,ScheduleDataBinding) Method

Reads an instance from the WebSchedule object model bound from the data model.
Syntax
'Declaration
 
Protected Overloads Function ReadObject( _
   ByVal reader As IDataReader, _
   ByVal binding As ScheduleDataBinding _
) As Object
protected object ReadObject( 
   IDataReader reader,
   ScheduleDataBinding binding
)

Parameters

reader
An IDataReader-implementation that has had Read called on it.
binding
A registered instance of any subclass of ScheduleDataBinding that is used when identifying the Type being bound across the data model into the WebSchedule object model

Return Value

An instance of a WebSchedule object model type, with values assigned to it's properties from those in the data record that has been read. The caller may confidently type cast this instance to the expected return type in the WebSchedule object model for which the supplied binding was responsible. For example, if ResourceBinding were passed, then it is safe to assume the CLR Type of the object returned by ReadRecord would be a Resource.
Remarks

Inheritors implementing their own operations on a custom data provider would invoke ReadRecord within the loop that calls Read on reader until the result set of an SQL command has been exhausted. Each call binds the database record to a new instance of a corresponding WebSchedule class by calling the CreateInstance method on binding.

The instance of the ScheduleDataBinding passed to binding must match the one a custom data provider has registered by calling Add (or AddRange) on DataBindings. If the same object reference is not found in DataBindings as is passed to the ReadRecord method, then metadata describing how data binding between the data model and object model should be performed will not be found, and this method fails. This metadata is cached the first time a particular ScheduleDataBinding gets added to the DataBindings collection because the initial map generation between object and data models is a relatively costly operation. Therefore, changes made to the ScheduleDataBinding instance between the time it was first added to the DataBindings and the time ReadRecord is called may not be reflected by the data bind.

ReadObject
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also