コード例 #1
0
ファイル: Index.aspx.cs プロジェクト: slogsdon/ThumbsUp
        protected List<DBItem> GetSubmissionsQueryCallback(OleDbDataReader reader)
        {
            List<DBItem> returnList = new List<DBItem>();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    DBItem item = new DBItem();

                    item.ID = reader.GetInt32(reader.GetOrdinal("ID"));
                    item.User = reader.GetString(reader.GetOrdinal("User"));
                    item.DateTime = reader.GetDateTime(reader.GetOrdinal("DateTime"));
                    item.Person = reader.GetString(reader.GetOrdinal("Person"));
                    item.Rating = reader.GetString(reader.GetOrdinal("Rating"));
                    item.Description = reader.GetString(reader.GetOrdinal("Description"));
                    item.Votes = reader.GetString(reader.GetOrdinal("Votes"));

                    returnList.Add(item);
                }
            }
            return returnList;
        }
コード例 #2
0
ファイル: Index.aspx.cs プロジェクト: slogsdon/ThumbsUp
        protected List<DBItem> GetVotesQueryCallback(OleDbDataReader reader)
        {
            List<DBItem> returnList = new List<DBItem> { };

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    DBItem item = new DBItem();
                    item.Votes = reader.GetString(reader.GetOrdinal("Votes"));
                    returnList.Add(item);
                }
            }
            return returnList;
        }