资源简介
这是一个针对System.Data.SQLite的数据库常规操作封装的C#通用类,调用此类可以快速的加快开发速度,直接调用即可,里面也有详细的注释说明!
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Configuration;
using System.Data.Common;
using System.Data.SQLite;
using System.IO;
using System.Windows.Forms;
namespace Common.Tools
{
///
/// 说明:这是一个针对System.Data.SQLite的数据库常规操作封装的通用类。
/// huangjie add 2014-10-31
///
public class SQLiteDBHelper
{
private string dbPath = Application.StartupPath + “\\Database.db3“;
private string connectionString = string.Empty;
#region 数据库连接必要条件参数
private SQLiteConnection dbConnection = null;
///
/// 数据库连接
///
public SQLiteConnection DbConnection
{
get
{
if (this.dbConnection == null)
{
// 若没打开,就变成自动打开关闭的
this.Open();
this.AutoOpenClose = true;
}
return this.dbConnection;
}
set
{
this.dbConnection = value;
}
}
private SQLiteCommand dbCommand = null;
///
/// 命令
///
public SQLiteCommand DbCommand
{
get
{
return this.dbCommand;
}
set
{
this.dbCommand = value;
}
}
private SQLiteDataAdapter dbDataAdapter = null;
///
/// 数据库适配器
///
public SQLiteDataAdapter DbDataAdapter
{
get
{
return this.dbDataAdapter;
}
set
{
this.dbDataAdapter = value;
}
}
///
/// 数据库连接
///
public string ConnectionString
{
get
{
return this.connectionString;
}
set
{
this.connectionString = value;
}
}
private SQLiteTransaction dbTransaction = null;
private bool inTransaction = false;
///
/// 是否已采用事务
///
public bool InTransaction
{
get
{
return this.inTransaction;
}
set
{
this.inTransaction = value;
}
}
private bool autoOpenClose = false;
///
/// 默认打开关闭数据库选项(默认为否)
///
public bool AutoOpenClose
{
get
{
return autoOpenClose;
}
set
{
autoOpenClose = value;
}
}
#endregion
- 上一篇:asp.net 在线拍照
- 下一篇:c#的P2P聊天程序完整源码
相关资源
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
评论
共有 条评论