91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 16KB
    文件類型: .cs
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-07
  • 語言: C#
  • 標(biāo)簽: SQLite??C#??

資源簡介

這是一個(gè)針對System.Data.SQLite的數(shù)據(jù)庫常規(guī)操作封裝的C#通用類,調(diào)用此類可以快速的加快開發(fā)速度,直接調(diào)用即可,里面也有詳細(xì)的注釋說明!

資源截圖

代碼片段和文件信息

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
{
????///??
????///?說明:這是一個(gè)針對System.Data.SQLite的數(shù)據(jù)庫常規(guī)操作封裝的通用類。?
????///?huangjie?add?2014-10-31
????///?
????
????public?class?SQLiteDBHelper
????{
????????private?string?dbPath?=?Application.StartupPath?+?“\\Database.db3“;
????????private?string?connectionString?=?string.Empty;

????????#region?數(shù)據(jù)庫連接必要條件參數(shù)

????????private?SQLiteConnection?dbConnection?=?null;
????????///?
????????///?數(shù)據(jù)庫連接
????????///?

????????public?SQLiteConnection?DbConnection
????????{
????????????get
????????????{
????????????????if?(this.dbConnection?==?null)
????????????????{
????????????????????//?若沒打開,就變成自動(dòng)打開關(guān)閉的
????????????????????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;
????????///?
????????///?數(shù)據(jù)庫適配器
????????///?

????????public?SQLiteDataAdapter?DbDataAdapter
????????{
????????????get
????????????{
????????????????return?this.dbDataAdapter;
????????????}
????????????set
????????????{
????????????????this.dbDataAdapter?=?value;
????????????}
????????}

????????///?
????????///?數(shù)據(jù)庫連接
????????///?

????????public?string?ConnectionString
????????{
????????????get
????????????{
????????????????return?this.connectionString;
????????????}
????????????set
????????????{
????????????????this.connectionString?=?value;
????????????}
????????}

????????private?SQLiteTransaction?dbTransaction?=?null;
????????private?bool?inTransaction?=?false;
????????///?
????????///?是否已采用事務(wù)
????????///?

????????public?bool?InTransaction
????????{
????????????get
????????????{
????????????????return?this.inTransaction;
????????????}
????????????set
????????????{
????????????????this.inTransaction?=?value;
????????????}
????????}
????????private?bool?autoOpenClose?=?false;
????????///?
????????///?默認(rèn)打開關(guān)閉數(shù)據(jù)庫選項(xiàng)(默認(rèn)為否)
????????///?

????????public?bool?AutoOpenClose
????????{
????????????get
????????????{
????????????????return?autoOpenClose;
????????????}
????????????set
????????????{
????????????????autoOpenClose?=?value;
????????????}
????????}

????????#endregion



評論

共有 條評論