Populates the properties of an object from a single DataReader row using Reflection by matching the DataReader fields to a public property on the object passed in. Unmatched properties are left unchanged.
You need to pass in a data reader located on the active row you want to serialize.
This routine works best for matching pure data entities and should be used only in low volume environments where retrieval speed is not critical due to its use of Reflection.
public static void DataReaderToObject(IDataReader reader, object instance, string propertiesToSkip, Dictionary<String,PropertyInfo> piList)
Instance of the DataReader to read data from. Should be located on the correct record (Read() should have been called on it before calling this method)
Instance of the object to populate properties on
Optional - A comma delimited list of object properties that should not be updated
Optional - Cached PropertyInfo dictionary that holds property info data for this object
See also:Class DataUtils
Comment or report problem with topic