Exemplo n.º 1
0
        /// <summary>
        /// check key data
        /// 键值是否存在
        /// </summary>
        /// <param name="KeyName"></param>
        /// <returns></returns>
        public Boolean Exist(String KeyName)
        {
            //数据库连接
            if (_connectionConfig.IsAutoCloseConnection == false)
            {
                if (_database.CheckStatus() == false)
                {
                    throw new Exception("databse connect not open");
                }
            }
            if (_connectionConfig.IsAutoCloseConnection == true)
            {
                _database.Open();
            }
            Boolean ds = _database.ExistKey(KeyName);

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

            return(ds);
        }
Exemplo n.º 2
0
 /// <summary>
 /// close connect
 /// 长关闭数据库
 /// </summary>
 public void Close()
 {
     database.Close();
 }