Repeater的ItemDataBound 事件中e.Item.DataItem 的数据类型

1、使用DataSet和DataTable绑定数据源时

DataRowView view = (DataRowView)e.Item.DataItem;

2、DataReader绑定数据源时

System.Data.Common.DbDataRecord view = (System.Data.Common.DbDataRecord)e.Item.DataItem;

3、使用泛型做数据源时,则是泛型对应的类型。

例如 IList 为数据源
DocumentInfo docInfo = (DocumentInfo)e.Item.DataItem;

原文地址:https://www.cnblogs.com/minghualiyan/p/3507570.html