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;

 

你可能感兴趣的:(reader)