ADO.NET中ExcuteReader读取存储过程获取的多行数据

DLL层调用:

                List<BookInfo> tupleList = new List<BookInfo>();
using (IDataReader reader = this.AdoHelper.ExecuteReader(this.ConnectionString, CommandType.StoredProcedure, "FN_VOTEBOOKIDNAME_GET", paramArray))
{
while (reader.Read())
{
BookInfo tuple = new BookInfo();
tuple.BookId = Field.GetInt32(reader, "BookId");
tuple.BookName = Field.GetString(reader, "bookname");
tupleList.Add(tuple);
}
}
return tupleList;
上一篇:Spark技术内幕:Master基于ZooKeeper的High Availability(HA)源代码实现


下一篇:spring整合hibernate的详细步骤