Exemple #1
0
        /// <summary>
        /// get recordnumber data by filter
        /// 得到指定数据的指定内容
        /// </summary>
        /// <param name="RecordNumber">记录数 Record number</param>
        /// <returns></returns>
        public IHashTable TopNumber(Int32 RecordNumber)
        {
            //数据库连接
            if (_connectionConfig.IsAutoCloseConnection == false)
            {
                if (_database.CheckStatus() == false)
                {
                    throw new Exception("databse connect not open");
                }
            }
            if (_connectionConfig.IsAutoCloseConnection == true)
            {
                _database.Open();
            }

            List <Hashtable> hr;

            if (filterDefinition != null)
            {
                hr = _database.GetTopRecordsData(_databasename, _TableName,
                                                 new BsonDocument(), RecordNumber);
            }
            else
            {
                hr = _database.GetTopRecordsData(_databasename, _TableName,
                                                 filterDefinition, RecordNumber);
            }

            if (_connectionConfig.IsAutoCloseConnection == true)
            {
                _database.Close();
            }

            IHashTable DT = new IHashTable(hr);

            return(DT);
        }