Perst我使用的版本是4, 几乎支持所有的.net环境, 而且效率很高,比较稳定。

使用方法:

1:引用相应dll

2: 创建数据结构

public class Cp_struct : Persistent, System.ComponentModel.INotifyPropertyChanged

{

[FullTextIndexable]  // 创建索引

public string Cpph;

public string cpph { get { return this.Cpph; } set { if (this.Cpph != value) { this.Cpph = value; OnPropertyChanged("cpph"); } } }

public string cpmz { get { return this.Cpmz; } set { if (this.Cpmz != value) { this.Cpmz = value; OnPropertyChanged("cpmz"); } } }         public string Cpmz;

public string ddjs { get { return this.Ddjs; } set { if (this.Ddjs != value) { this.Ddjs = value; OnPropertyChanged("ddjs"); } } } public string Ddjs;

public decimal dj { get { return this.Dj; } set { if (this.Dj != value) { this.Dj = value; OnPropertyChanged("dj"); } } } public decimal Dj;

public decimal hydj { get { return this.Hydj; } set { if (this.Hydj != value) { this.Hydj = value; OnPropertyChanged("hydj"); } } } public decimal Hydj;

public string lastdate { get { return this.Lastdate; } set { if (this.Lastdate != value) { this.Lastdate = value; OnPropertyChanged("lastdate"); } } } public string Lastdate;

#region INotifyPropertyChanged Members

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

private void OnPropertyChanged(string propertyName)

{

System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;

if (handler != null)

{

handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));

}

#endregion

public override void OnLoad()

{

base.OnLoad();

}

public override void Deallocate()

{

base.Deallocate();

}

}

3: 创建数据库

public static Database db;

应用程序开启时打开数据库

Storage instanse = StorageFactory.Instance.CreateStorage();             //初始化数据库文件为1M

instanse.SetProperty("perst.file.extension.quantum", 512 * 1024);             //数据库大小不够时,每次增加512K

instanse.SetProperty("perst.extension.quantum", 512 * 1024);

instanse.Open("demo.dbf");

db = new Database(instanse);

应用程序关闭时关闭数据库连接

db.Storage.Close();

4 常用的方法有:

//检索:

List<PrintData_H> pp = App.db.Select<PrintData_H>(p => (p.bigAccountDataId == y.bigAccountDataId)).ToList();
List<City> list = App.db.Select<City>("order by CityNum").ToList();

// 新增
 App.db.AddRecord(x);
 App.db.Storage.Commit();

// 修改
x.Store();
 App.db.UpdateFullTextIndex(x);

// 删除
 App.db.DeleteRecord(x);
 App.db.Storage.Commit();

Perst常用命令的更多相关文章

  1. Linux 常用命令(持续补充)

    常用命令: command &:将进程放在后台执行 ctrl + z:暂停当前进程 并放入后台 jobs:查看当前后台任务 bg( %id):将任务转为后台执行 fg( %id):将任务调回前 ...

  2. LVM基本介绍与常用命令

    一.LVM介绍LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制LVM - 优点:LVM通常用于装备大量磁盘的系统,但它同样适 ...

  3. Linux学习笔记(一):常用命令

    经过统计Linux中能够识别的命令超过3000种,当然常用的命令就远远没有这么多了,按照我的习惯,我把已经学过的Linux常用命令做了以下几个方面的分割: 1.文件处理命令 2.文件搜索命令 3.帮助 ...

  4. git常用命令(持续更新中)

    git常用命令(持续更新中) 本地仓库操作git int                                 初始化本地仓库git add .                       ...

  5. 【原】npm 常用命令详解

    今年上半年在学习gulp的使用,对npm的掌握是必不可少的,经常到npm官网查询文档让我感到不爽,还不如整理了一些常用的命令到自己博客上,于是根据自己的理解简单翻译过来,终于有点输出,想学习npm这块 ...

  6. npm常用命令

    npm常用命令 环境:win7 npm 是什么 NPM(node package manager),通常称为node包管理器.顾名思义,它的主要功能就是管理node包,包括:安装.卸载.更新.查看.搜 ...

  7. Git 常用命令

    一.初始環境配置 git config --global user.name "John Doe"git config --global user.email johndoe@ex ...

  8. linux iptables常用命令之配置生产环境iptables及优化

    在了解iptables的详细原理之前,我们先来看下如何使用iptables,以终为始,有可能会让你对iptables了解更深 所以接下来我们以配置一个生产环境下的iptables为例来讲讲它的常用命令 ...

  9. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

随机推荐

  1. JavaWeb 学习005-4个页面,5条sql语句(添加、查看、修改、删除)

    今天完成了的事: = 1.班级模块,list页面的添加班级信息操作,中文乱码问题 尚待解决 这俩天做得工作是: 首先搭建好main页面:是由top.left.right三个部分构成的,拼接到一起. 流 ...

  2. Trie / Radix Tree / Suffix Tree

    Trie (字典树) "A", "to", "tea", "ted", "ten", "i ...

  3. python学习之路-day12-mysql && orm

    一.数据库 1.数据库介绍 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据.我们也可以将数据存储 ...

  4. eyegaze

    1. eye_gaze https://github.com/iitmcvg/eye-gaze 2.deepgaze https://github.com/mpatacchiola/deepgaze ...

  5. 大漠绑定测试工具-VB6

    获取更新开始|版本:3.1652版 2016年12月27日|更新内容:1.取消自动更新错误的提示.\n\n友情提示:如网盘失效,请加QQ群(568073679)下载最新版|下载地址:http://ww ...

  6. iOS Sonar 集成流程

    https://gold.xitu.io/entry/5781e6872e958a0054c93368 作者:advancer_chen,原文链接:http://my.oschina.net/Chen ...

  7. SVN系统的几个术语

    SVN系统的几个术语 User:用户,可以远程连接到SVN服务器的权限实体. User Group:用户组,用于管理一组权限相同的用户. Repository:版本库,在服务器端保存着的项目中所有的文 ...

  8. android系统启动

    首页 资讯 精华 论坛 问答 博客 专栏 群组 更多 ▼ 您还未登录 ! 登录 注册 Ant space   博客 微博 相册 收藏 留言 关于我     android启动过程再研   Androi ...

  9. ubuntu 安装apache2并配置cgi,搭建mimetex转化公式图片的服务

    一.Apache的安装 在终端输入: sudo apt-get install apache2 二.启动.停止Apache服务 Apache的启动和停止文件是:/etc/init.d/apache2 ...

  10. office中通过宏添加快捷键

    把“Microsoft 公式 3.0”作为一个按钮放在 2013中的快速访问工具栏的方法 在使用office办公软件的过程中,因为有的人还在使用office2003版本,所以在使用高版本的office ...