資源簡介
為什么項目使用Sqlite而不是使用Access數據庫,他們之間有那些特點。
1、Access特點
我們做小項目的時候特別是小的MIS系統一般也都要用數據庫來保存數據,大部分的小系統都是用Access數據庫,Access使用上確實非常方便,也方便對數據進行管理維護等優點,復制過去即可使用。但其實Access數據庫本身也存在很多的問題:性能不行;數據不安全,用戶可以直接用Access打開數據庫文件進行數據修改,即使加密后都可以直接破解;Access的數據量一大,文件本身的體積就異常龐大;Access數據庫文件很容易損壞等。
2、 SQLite特點
-
事務操作是原子,一致,孤立,并且持久的(ACID),即使在系統崩潰和電源故障之后。
-
零配置——不需要安裝和管理。
-
實現了絕大多數SQL92標準。
-
整個數據庫存儲在一個單一的文件中。
-
數據庫文件可以在不同字節序的機器之間自由地共享。
-
支持最大可達2T的數據庫。 (241 字節)
-
字符串和BLOB類型的大小最大可達 2G 字節(231字節)。
-
小的代碼: 完整配置的少于250KB,忽略一些可選特性的少于150KB。
-
在大多數常見操作上比流行的客戶/服務器數據庫引擎更快。
-
簡單,易于使用的API。
-
內建TCL綁定。 另外提供可用于許多其他語言的綁定。
-
具有良好注釋的源代碼,95%經過測試。
-
獨立:沒有外部依賴。
-
源代碼位于公共域。 可用于任何用途。
朋友介紹操作SQLite使用工具SQLiteSpy,實際上這個工具不支持數據庫(如Access數據庫)的導入,偶然發現還有SQLite Developer這樣一個工具,管理上非常方便,操作圖如下所示,使用發現功能比較豐富,支持對表字段定義的直接修改,編輯數據、Sql查詢、創建、壓縮、備份數據庫等,對中文支持也不錯。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?WHC.Pager.Entity;
using?System.Data.Common;
using?WHC.OrderWater.Commons;
using?System.Data.SQLite;
namespace?WHC.OrderWater.UI
{
????public?partial?class?FrmCustomer?:?Form
????{
????????string?connectionString?=?““;
????????public?FrmCustomer()
????????{
????????????InitializeComponent();
????????????connectionString?=?string.Format(@“Data?Source={0}\OrderWater.db;Version=3;“?Application.StartupPath);
????????}
????????private?void?FrmCustomer_Load(object?sender?EventArgs?e)
????????{
????????????EnableDate(false);
????????????InitArea();
????????????InitType();
????????????this.w
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????864??2011-11-24?08:50??App.config
?????文件?????744934??2011-11-24?08:50??app.ico
?????文件??????21095??2011-11-24?08:50??FrmCustomer.designer.cs
?????文件???????6220??2011-11-24?08:50??FrmCustomer.resx
?????文件???????7182??2011-11-24?08:50??FrmEditCustomer.cs
?????文件??????30176??2011-11-24?08:50??FrmEditCustomer.designer.cs
?????文件???????5814??2011-11-24?08:50??FrmEditCustomer.resx
?????文件???????1251??2011-11-24?08:50??Program.cs
?????文件???????5328??2011-11-24?10:38??TestPager_SqlLite.csproj
?????文件??????12407??2011-11-24?10:45??FrmCustomer.cs
?????文件???????1390??2011-11-24?08:49??Properties\AssemblyInfo.cs
?????文件???????2884??2011-11-24?08:49??Properties\Resources.Designer.cs
?????文件???????5612??2011-11-24?08:49??Properties\Resources.resx
?????文件???????1102??2011-11-24?08:49??Properties\Settings.Designer.cs
?????文件????????249??2011-11-24?08:49??Properties\Settings.settings
?????文件????4481024??2010-09-11?15:56??bin\Debug\Aspose.Cells.dll
?????文件??????32768??2007-05-28?12:42??bin\Debug\ControlLibrary.dll
?????文件?????249856??2005-03-21?01:38??bin\Debug\log4net.dll
?????文件??????14336??2011-11-24?10:25??bin\Debug\OrderWater.db
?????文件?????847872??2011-11-01?14:06??bin\Debug\System.Data.SQLite.DLL
?????文件??????37888??2011-11-24?17:45??bin\Debug\TestPager_SqlLite.exe
?????文件????????932??2011-11-24?17:46??bin\Debug\TestPager_SqlLite.exe.config
?????文件??????16384??2011-11-24?10:31??bin\Debug\WHC.Pager.Entity.dll
?????文件?????157696??2011-11-24?10:34??bin\Debug\WHC.Pager.WinControl.dll
?????文件??????52831??2011-11-24?10:33??bin\Debug\WHC.Pager.WinControl.xm
?????文件???????1191??2011-11-24?08:50??Commons\LogHelper.cs
?????文件???????2283??2011-11-24?08:50??Commons\MessageUtil.cs
?????文件??????21239??2011-11-24?08:50??Commons\SearchCondition.cs
?????目錄??????????0??2011-11-24?17:48??bin\Debug
?????目錄??????????0??2011-11-24?08:49??Properties
............此處省略5個文件信息
評論
共有 條評論