通常在大型系统和网站一般使用的数据基本上就是Oracle,MySQL,MSSqlServer三种。但是在某些情况下会相对麻烦,如果仅仅需要在客户端保存一些数据。SQLite无疑是最佳选择之一。他是一种轻量级数据库。不用安装任何插件或者软件来辅助,只是一个简单的文件。直接打包在客户端程序内即可。

1,创建Sqlite。

为了方便程序开发,一般把Sqlite签入Vs内部当做一个插件来使用。默认Vs是不支持Sqlite的,为了让其支持我们需要下载SQLite-1.0.66.0-setup.exe  进行安装,这时候你会发现vs的的数据源连接中多了一项:

为了及时观察sqlite数据中数据变化,每次都打开vs连接再查看很费时间,只需要下载一个特小的软件即可轻松搞定。下载地址: SQLite Database Browser.exe    下载后解压到桌面,+98

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAADeCAIAAADtgK2tAAAa8klEQVR4nO2dabgU1ZmA+7dmzIhbxjFuUaIRBVQ0cb3uCxpBjEY0egU1CsqOirJcEBFE9k12BREVRSICGsUNUYzLoHNGRx2XcaIzcRnnz/zu+VHSU/csX53qrqquqn6/5336qa4+a3X121+f2123stthg3Y7bNDuhw/e/fDBu3cd/JOut/yk6y1/98uAW/c44tY9jrh1jyOH/DTgV0P/PuCoYXseNWzPbsO6dBvWpdvwLkcP3+vo4XsdM2KvY0bsfcyIvbuP3Lv7yH26j9ynx6h9eozat+eofXuO2q/n6P2OHb3fsaN/dtxtAf9w/O0B+/e6Y/9ed/zjCQFjDjhxzAEnjjng13f+POA3dx0YcNLYg04ae9DJYw8+edzBJ487+JRxh5wy7pBTxh9y6vhDTx1/6GkTDj1twi9Om/CL0zsOO73jsLaOw9o6Dm+bePgZEw8/Y2LXMyZ1PXNS1zMn/fKsuwOOOHvyEWdPPvLsyUeeM/nIc+751bkBU446b8pR50056vx7uwVcMPXoC6YefcHUYy6cesyF047pPa1772nde9/X/aL7elx0X4+Lp/e4eHrPi6f3/O39xwZcMuO4S2Yc12fGcX1mHN9n5vF9Zx7fd2avvrN6XTqr16WzTug3+4R+s0/sN/vEy+aceNm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L7zzMxrmuV6s8zbRnbR+Df/24zlWdZWSdrctcZmGtfKQKrUffbNyly0gnao14Fsv4iYcCkaBzrWmB9eXg86ppkMzyXO315ZpLxeaZxF+DeXGurEL5rusYWY+avG2ei+ECrtFaxxzeKTzBwlDTeL6hiFSSznMjXyPCiVcO5wpzsVolQXLhXPlIuY6XXMx1ZCOda33Up3z4IbkdYSQ4F0ySda6ZClhThwzI0rlaOmUeivBtqsckL841J2lua0fQbMp1sKwPuRrR9phjdpW3jll45qx9mQ0m+3xDEakk7dzwWaocDop8yTROrvJc7ZiYdZOdtX2c/vXjOtecniw7rZbnAbU2KG/X7VyhojAd1xTSe76hiCToXNO2kUpN7yTMT54bvpvq24xqYp6rOjtUUGGkhiJ9Hcu5whNj3TCfGNczJ0wE54JAgs5Vxudo5Tj9XOdkgjQ3z3W91tJ+DTZ5bUE5DFXbo1WRlSofSvOuKXfhnHONShhP5HMW990FWpNUnetKC6yJRbLnZMbO1fRiLSMfkwRnbR+nf/061haEPfIkrXXN08V1cM2jrxwm1Q668JSEy5hNxZ2OTy1oKSqZr+eq0IsivVMx4+/nKuNVbE7WnG8enRtZJtm3rPKR9vsqFJ3EnWu9dW0U3bmuuSvjPcbcad5Natb24fnUFzJcLdsFgPpI1rnhZsMbQmKbUk7QFOe6lOp6v8mdcwEgbVJybtPhegsaOBcgF+DcMoFzAfIOzi0TOBcg7wTO9blWdeEC53Z6ops+OABQO3dUKhX5KtWFDpdzm/12kGK04VyAPGN+m7BkYU652W8EqYf9iW76qQYA0DrgXACAjKhWqzgXACALqtVqe3s7zgUASJ1AuDgXACB1asJVrOcCAKRKWLis5wIApIgmXNYWAADSwhRue3v7/wGz7XK6iWLEOAAAAABJRU5ErkJggg==" alt="" />

选择此数据源。确定

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAHgCAIAAABMzLPaAAAgAElEQVR4nO2dZ7csR3VA57vB2GBjcDaYJCRA5CR0yTmInHNWFsrxKueccxYiRwEiiCgQso1l3DY2YJONbcD4H4w/3LfGdavqnDrdXd3VXbPP2uutmZ7q6jqnanfPzJuZu/idB+y53B6/++B9tm783k77/t5D9/39h+73+zvvd8+d97/nLvvfa5cD3JZ/+IgD773rgVu37/PIg+/zqIPv+6iD7/voQ/74MYf88WMO3dr+p487bOvGnz3+iD9/whF//sQj/uKJR/7Fk478yycdtbX9r3Y7+n67HeN2+4CNYx/w1GMf+NTjHvi04x70tOMe9PTjH/z04x/8jBMe8swTHvLME3d61ok7Peukhz77pIc++6Sdn3Pyzs85eZfnnrLL80552PNOfdjzT3348097+AtOe8QLTn/EC0/f9YWn7/qiMx754jMe9eIzH/WSMx/9krMevcdZj9nj7Me89OzHvvTsx77snMe9/JzHvfzcx7/i3Me/4rwnvPK8J7zy/Ce+6vwnvur8J736gie95oInv+bCJ7/2wt1ee9Fur7voKa+7ePfXX7z76y/ZeMMlG2+85KlvvPSpb7r0aW+67Glvvuzpb7786W+5/BlvueIZb73imW+94plvu/JZb7/yWW+/6tnvuOrZ77j6Oe+8+jnvvPq577rmue+65nnvvvZ577n2+e+57gXvve4F773+hXte/8I9b3jRXje8aK8bXrz3jS/e58aX7HPTS/a9aY9937/Hfu9/6X43v3T/m1+2/80vO+ADL3/fB17+vg++4sAPvuLAD73yoA+98qAPv+rgD7/q4A+/+pCPvPrQj7zm0I++9rCPvvawj73u8I+97vCPv/6Ij7/+iE+84chPvOGoT7zxqE++8ehPvunoT73pmE+9+ZhPv3nz02/ZvOUtx97y1mNveetxn3nb8Z952/GfffsJn337CZ97x4mfe8eJt77zpFvfddKt7zr58+8+5fPvPuUL7zn1C+859YvvPe2L7z3tS3ue/qU9T79trzNu2+vM2/Y+88t7n/Xlfc76yj5nf2Xfs7+67zlf3e+cr+537tf2P+9r+5/39QPO//oB53/jfRd848ALbj/wwtsPuvD2gy765sEXf/Pgi791yCXfOuSSOw699I5DL/32YZd9+7DL7jz88jsPv+LOI674myOu/Jsjr/zbI6/626Ou+rujrv67o6/+ztHXfOeYa76z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  点击Browse用来打开已存在的数据库文件。

现在数据库已经创建,然后就是创建表,

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALgAAADKCAIAAACZux1aAAAP30lEQVR4nO2de1BU1x3Ht5P/Op1OZ9pm2kkfydRpO3lM04w2aZu2Jp02MeTlxGjSaKKhdVQ0El8kligRTRARUaGglHdYHgZRAUV5ylueUREIL3kpClFEXNhdZG//2Gbneu+5Z39793WzfD9zxrl79pxzz733w++3e+9BdFeHLovLwdRTwte8fUAnKaXdxwZGhKERU/81Y1p+y7wF/pLu4nI8N7ulobK5vrKpvqK6oqix7mxDbXlNZXFF2em66tLaqpKKssKE+EPMvnq9Xl7Z39Np3cjcv+L8sYXXLu2cHE0RhjZOlM7pTbqvdM8Pojb8zdbYb8lKztzySxqHRkyXh41dQ1Pt/ZMXew0tnXdKGq4dK+s5fKRuZePKTZ8kc7rPwqIbGugRF6soFkG4e9diviu8fUC3bJfuZNe+vI59TVfbBkaE3lGhb9jYfXXKKoqku7gcO5rVXF/RdK7Cqkh9Tdm56lKrIjWVxdUVRVZRmH31ej1n5O7WyoLULUl7l/8ndNneLS9ErJt7IPDxtPCl/9wUtjRg26IVG/0Wr+R0r29ozMivTT56Nk5ftC8x75OYIx/tTdu0Mz7go+h3N0W8uXbnq/7Bzy/dnHuyjDPIbCu6gb5OcTmYespisdydEUxmYdIoTEwKbx/QjdwShm8Kg6PC5etC57DQc8XYMTBpFUXSXVyO5WQ1njvbUFdeX1t+rqasrrq0rqqktrK4pqK4uqKo6uwZqyjMvnq9njOyUlkWsG3Rig1+i1c+6/cmp1lGQZ01ZN6dsUyZZm7dmR6+YeodNrb3TzZ13qluvV3SfCu3fODZxYEq5uCrRdfX2yEuB1NP3Z2xdHT3X2jvq79wubL5clFdT15ld05ZV0bRPcUqiqS7uBzLyaqvLa8oK+SUhPhDzL56vZ4zMrMsXbOtr7fDb8nKZ/zefGr+i5yW6SdqBEEIqg4ymixXTz16fczcf91UWNn62fGqfYn5H4anBe1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JiAJIQBRAAqIAEhAFkIAogAREASQgCiABUQAJiAJIQBRAAqIAEhAFkIAogAREASQgCiABUQAJiAJI/A+Y3F58PZBlYQAAAABJRU5ErkJggg==" alt="" />

右键Tables选择创建表,接下来的操作和mssqlserver基本一样。这里不具体描述。可能会在后面章节详细介绍。只能说可能会介绍,但是如何在代码中对sqlite数据操作肯定会介绍的。如果你想使用sqlite。后面的内容一定会帮到你。

2.操作数据库

和其他数据库类似,既然要对数据库进行一系列的操作(增删改查)少不了一套方法, 和其他数据库的命令大同小异。

下面封装的一个SqliteHelper类。

 using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SQLite;
using System.Configuration; namespace Test
{
public class SqliteHelper
{
//数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库.
public static string connectionString = "Data Source=test"; public SqliteHelper() { } #region 公用方法 public static int GetMaxID(string FieldName, string TableName)
{
string strsql = "select max(" + FieldName + ")+1 from " + TableName;
object obj = GetSingle(strsql);
if (obj == null)
{
return ;
}
else
{
return int.Parse(obj.ToString());
}
} public static bool Exists(string strSql)
{
object obj = GetSingle(strSql);
int cmdresult;
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
cmdresult = ;
}
else
{
cmdresult = int.Parse(obj.ToString());
}
if (cmdresult == )
{
return false;
}
else
{
return true;
}
} public static bool Exists(string strSql, params SQLiteParameter[] cmdParms)
{
object obj = GetSingle(strSql, cmdParms);
int cmdresult;
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
cmdresult = ;
}
else
{
cmdresult = int.Parse(obj.ToString());
}
if (cmdresult == )
{
return false;
}
else
{
return true;
}
} #endregion #region 执行简单SQL语句 /// <summary>
/// 执行SQL语句,返回影响的记录数
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSql(string SQLString)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand(SQLString, connection))
{
try
{
connection.Open();
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (System.Data.SQLite.SQLiteException E)
{
connection.Close();
throw new Exception(E.Message);
}
}
}
} /// <summary>
/// 执行SQL语句,设置命令的执行等待时间
/// </summary>
/// <param name="SQLString"></param>
/// <param name="Times"></param>
/// <returns></returns>
public static int ExecuteSqlByTime(string SQLString, int Times)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand(SQLString, connection))
{
try
{
connection.Open();
cmd.CommandTimeout = Times;
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (System.Data.SQLite.SQLiteException E)
{
connection.Close();
throw new Exception(E.Message);
}
}
}
} /// <summary>
/// 执行多条SQL语句,实现数据库事务。
/// </summary>
/// <param name="SQLStringList">多条SQL语句</param>
public static void ExecuteSqlTran(ArrayList SQLStringList)
{
using (SQLiteConnection conn = new SQLiteConnection(connectionString))
{
conn.Open();
SQLiteCommand cmd = new SQLiteCommand();
cmd.Connection = conn;
SQLiteTransaction tx = conn.BeginTransaction();
cmd.Transaction = tx;
try
{
for (int n = ; n < SQLStringList.Count; n++)
{
string strsql = SQLStringList[n].ToString();
if (strsql.Trim().Length > )
{
cmd.CommandText = strsql;
cmd.ExecuteNonQuery();
}
}
tx.Commit();
}
catch (System.Data.SQLite.SQLiteException E)
{
tx.Rollback();
throw new Exception(E.Message);
}
}
} /// <summary>
/// 执行带一个存储过程参数的的SQL语句。
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <param name="content">参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSql(string SQLString, string content)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
SQLiteCommand cmd = new SQLiteCommand(SQLString, connection);
SQLiteParameter myParameter = new SQLiteParameter("@content", DbType.String);
myParameter.Value = content;
cmd.Parameters.Add(myParameter);
try
{
connection.Open();
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (System.Data.SQLite.SQLiteException E)
{
throw new Exception(E.Message);
}
finally
{
cmd.Dispose();
connection.Close();
}
}
} /// <summary>
/// 执行带一个存储过程参数的的SQL语句。
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <param name="content">参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加</param>
/// <returns>影响的记录数</returns>
public static object ExecuteSqlGet(string SQLString, string content)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
SQLiteCommand cmd = new SQLiteCommand(SQLString, connection);
SQLiteParameter myParameter = new SQLiteParameter("@content", DbType.String);
myParameter.Value = content;
cmd.Parameters.Add(myParameter);
try
{
connection.Open();
object obj = cmd.ExecuteScalar();
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
return null;
}
else
{
return obj;
}
}
catch (System.Data.SQLite.SQLiteException E)
{
throw new Exception(E.Message);
}
finally
{
cmd.Dispose();
connection.Close();
}
}
} /// <summary>
/// 向数据库里插入图像格式的字段(和上面情况类似的另一种实例)
/// </summary>
/// <param name="strSQL">SQL语句</param>
/// <param name="fs">图像字节,数据库的字段类型为image的情况</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSqlInsertImg(string strSQL, byte[] fs)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
SQLiteCommand cmd = new SQLiteCommand(strSQL, connection);
SQLiteParameter myParameter = new SQLiteParameter("@fs", DbType.Binary);
myParameter.Value = fs;
cmd.Parameters.Add(myParameter);
try
{
connection.Open();
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (System.Data.SQLite.SQLiteException E)
{
throw new Exception(E.Message);
}
finally
{
cmd.Dispose();
connection.Close();
}
}
} /// <summary>
/// 执行一条计算查询结果语句,返回查询结果(object)。
/// </summary>
/// <param name="SQLString">计算查询结果语句</param>
/// <returns>查询结果(object)</returns>
public static object GetSingle(string SQLString)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand(SQLString, connection))
{
try
{
connection.Open();
object obj = cmd.ExecuteScalar();
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
return null;
}
else
{
return obj;
}
}
catch (System.Data.SQLite.SQLiteException e)
{
connection.Close();
throw new Exception(e.Message);
}
}
}
} /// <summary>
/// 执行查询语句,返回SQLiteDataReader(使用该方法切记要手工关闭SQLiteDataReader和连接)
/// </summary>
/// <param name="strSQL">查询语句</param>
/// <returns>SQLiteDataReader</returns>
public static SQLiteDataReader ExecuteReader(string strSQL)
{
SQLiteConnection connection = new SQLiteConnection(connectionString);
SQLiteCommand cmd = new SQLiteCommand(strSQL, connection);
try
{
connection.Open();
SQLiteDataReader myReader = cmd.ExecuteReader();
return myReader;
}
catch (System.Data.SQLite.SQLiteException e)
{
throw new Exception(e.Message);
}
//finally //不能在此关闭,否则,返回的对象将无法使用
//{
// cmd.Dispose();
// connection.Close();
//}
} /// <summary>
/// 执行查询语句,返回DataSet
/// </summary>
/// <param name="SQLString">查询语句</param>
/// <returns>DataSet</returns>
public static DataSet Query(string SQLString)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
DataSet ds = new DataSet();
try
{
connection.Open();
SQLiteDataAdapter command = new SQLiteDataAdapter(SQLString, connection);
command.Fill(ds, "ds");
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
return ds;
}
} public static DataSet Query(string SQLString, string TableName)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
DataSet ds = new DataSet();
try
{
connection.Open();
SQLiteDataAdapter command = new SQLiteDataAdapter(SQLString, connection);
command.Fill(ds, TableName);
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
return ds;
}
} /// <summary>
/// 执行查询语句,返回DataSet,设置命令的执行等待时间
/// </summary>
/// <param name="SQLString"></param>
/// <param name="Times"></param>
/// <returns></returns>
public static DataSet Query(string SQLString, int Times)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
DataSet ds = new DataSet();
try
{
connection.Open();
SQLiteDataAdapter command = new SQLiteDataAdapter(SQLString, connection);
command.SelectCommand.CommandTimeout = Times;
command.Fill(ds, "ds");
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
return ds;
}
} #endregion #region 执行带参数的SQL语句 /// <summary>
/// 执行SQL语句,返回影响的记录数
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSql(string SQLString, params SQLiteParameter[] cmdParms)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand())
{
try
{
PrepareCommand(cmd, connection, null, SQLString, cmdParms);
int rows = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
return rows;
}
catch (System.Data.SQLite.SQLiteException E)
{
throw new Exception(E.Message);
}
}
}
} /// <summary>
/// 执行多条SQL语句,实现数据库事务。
/// </summary>
/// <param name="SQLStringList">SQL语句的哈希表(key为sql语句,value是该语句的SQLiteParameter[])</param>
public static void ExecuteSqlTran(Hashtable SQLStringList)
{
using (SQLiteConnection conn = new SQLiteConnection(connectionString))
{
conn.Open();
using (SQLiteTransaction trans = conn.BeginTransaction())
{
SQLiteCommand cmd = new SQLiteCommand();
try
{
//循环
foreach (DictionaryEntry myDE in SQLStringList)
{
string cmdText = myDE.Key.ToString();
SQLiteParameter[] cmdParms = (SQLiteParameter[])myDE.Value;
PrepareCommand(cmd, conn, trans, cmdText, cmdParms);
int val = cmd.ExecuteNonQuery();
cmd.Parameters.Clear(); trans.Commit();
}
}
catch
{
trans.Rollback();
throw;
}
}
}
} /// <summary>
/// 执行一条计算查询结果语句,返回查询结果(object)。
/// </summary>
/// <param name="SQLString">计算查询结果语句</param>
/// <returns>查询结果(object)</returns>
public static object GetSingle(string SQLString, params SQLiteParameter[] cmdParms)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand())
{
try
{
PrepareCommand(cmd, connection, null, SQLString, cmdParms);
object obj = cmd.ExecuteScalar();
cmd.Parameters.Clear();
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
return null;
}
else
{
return obj;
}
}
catch (System.Data.SQLite.SQLiteException e)
{
throw new Exception(e.Message);
}
}
}
} /// <summary>
/// 执行查询语句,返回SQLiteDataReader (使用该方法切记要手工关闭SQLiteDataReader和连接)
/// </summary>
/// <param name="strSQL">查询语句</param>
/// <returns>SQLiteDataReader</returns>
public static SQLiteDataReader ExecuteReader(string SQLString, params SQLiteParameter[] cmdParms)
{
SQLiteConnection connection = new SQLiteConnection(connectionString);
SQLiteCommand cmd = new SQLiteCommand();
try
{
PrepareCommand(cmd, connection, null, SQLString, cmdParms);
SQLiteDataReader myReader = cmd.ExecuteReader();
cmd.Parameters.Clear();
return myReader;
}
catch (System.Data.SQLite.SQLiteException e)
{
throw new Exception(e.Message);
}
//finally //不能在此关闭,否则,返回的对象将无法使用
//{
// cmd.Dispose();
// connection.Close();
//} } /// <summary>
/// 执行查询语句,返回DataSet
/// </summary>
/// <param name="SQLString">查询语句</param>
/// <returns>DataSet</returns>
public static DataSet Query(string SQLString, params SQLiteParameter[] cmdParms)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
SQLiteCommand cmd = new SQLiteCommand();
PrepareCommand(cmd, connection, null, SQLString, cmdParms);
using (SQLiteDataAdapter da = new SQLiteDataAdapter(cmd))
{
DataSet ds = new DataSet();
try
{
da.Fill(ds, "ds");
cmd.Parameters.Clear();
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
return ds;
}
}
} public static void PrepareCommand(SQLiteCommand cmd, SQLiteConnection conn, SQLiteTransaction trans, string cmdText, SQLiteParameter[] cmdParms)
{
if (conn.State != ConnectionState.Open)
conn.Open();
cmd.Connection = conn;
cmd.CommandText = cmdText;
if (trans != null)
cmd.Transaction = trans;
cmd.CommandType = CommandType.Text;//cmdType;
if (cmdParms != null)
{ foreach (SQLiteParameter parameter in cmdParms)
{
if ((parameter.Direction == ParameterDirection.InputOutput || parameter.Direction == ParameterDirection.Input) &&
(parameter.Value == null))
{
parameter.Value = DBNull.Value;
}
cmd.Parameters.Add(parameter);
}
}
} #endregion #region 参数转换
/// <summary>
/// 放回一个SQLiteParameter
/// </summary>
/// <param name="name">参数名字</param>
/// <param name="type">参数类型</param>
/// <param name="size">参数大小</param>
/// <param name="value">参数值</param>
/// <returns>SQLiteParameter的值</returns>
public static SQLiteParameter MakeSQLiteParameter(string name, DbType type, int size, object value)
{
SQLiteParameter parm = new SQLiteParameter(name, type, size);
parm.Value = value;
return parm;
} public static SQLiteParameter MakeSQLiteParameter(string name, DbType type, object value)
{
SQLiteParameter parm = new SQLiteParameter(name, type);
parm.Value = value;
return parm;
} #endregion
}
}

通过这个基本满足对sqlite的操作。

SQLite的使用的更多相关文章

  1. 【开源】分享2011-2015年全国城市历史天气数据库【Sqlite+C#访问程序】

    由于个人研究需要,需要采集天气历史数据,前一篇文章:C#+HtmlAgilityPack+XPath带你采集数据(以采集天气数据为例子),介绍了基本的采集思路和核心代码,经过1个星期的采集,历史数据库 ...

  2. UWP开发之ORM实践:如何使用Entity Framework Core做SQLite数据持久层?

    选择SQLite的理由 在做UWP开发的时候我们首选的本地数据库一般都是Sqlite,我以前也不知道为啥?后来仔细研究了一下也是有原因的: 1,微软做的UWP应用大部分也是用Sqlite.或者说是微软 ...

  3. 深入解析Sqlite的完美替代者,android数据库新王者——Realm

    写在前面: 又到一年一度七夕虐狗节,看着大家忍受着各种朋友圈和QQ空间还有现实生活中的轮番轰炸,我实在不忍心再在这里给大家补刀,所以我觉得今天不虐狗,继续给大家分享有用的. 如果你比较关心androi ...

  4. VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答

    用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...

  5. Android之SQLite数据存储

    一.SQLite保存数据介绍 将数据库保存在数据库对于重复或者结构化数据(比如契约信息)而言是理想之选.SQL数据库的主要原则之一是架构:数据库如何组织正式声明.架构体现于用于创建数据库的SQL语句. ...

  6. 【教程】SQLite数据库修复

    SQLite 大家都知道,就不多说了. 有时候数据量大了,或者存储过程中出现异常,数据库就可能会出问题. 这是以前公司产品出现过的问题,导致软件都打不开了,我花了不少时间才解决的,趁现在有空贡献出来. ...

  7. SQLite学习笔记(十)&&加密

    随着移动互联网的发展,手机使用越来越广泛,sqlite作为手机端存储的一种解决方案,使用也非常普遍.但是sqlite本身安全特性却比较弱,比如不支持用户权限,只要能获取到数据库文件就能进行访问:另外也 ...

  8. mono for android中使用dapper或petapoco对sqlite进行数据操作

    在mono for android中使用dapper或petapoco,很简单,新建android 类库项目,直接把原来的文件复制过来,对Connection连接报错部分进行注释和修改就可以运行了.( ...

  9. 【腾讯Bugly干货分享】微信iOS SQLite源码优化实践

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57b58022433221be01499480 作者:张三华 前言 随着微信iO ...

  10. 【腾讯Bugly干货分享】移动客户端中高效使用SQLite

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57b57f2a0703f7d31b9a3932 作者:赵丰 导语 iOS 程序能 ...

随机推荐

  1. js判断页面从何种浏览器打开

    问题 有时项目需要根据不同的设备进行不同的处理,需要判断到底是哪种设备打开了项目. 移动端浏览器检测 移动终端浏览器版本信息: var browser = { versions: function ( ...

  2. EXTJs前后台交互 常用哦3种方式

    <1>Ajax交互方式 Ext.Ajax.request( { //被用来向服务器发起请求默认的url url : "", //请求时发送后台的参数,既可以是Json对 ...

  3. MPI编程指南

    MPI编程指南 一.     MPI概述 1.1  MPI的发展史 MPI标准化涉及到大约60个国家的人们,他们主要来自于美国和欧洲的40个组织,这包括并行计算机的多数主要生产商,还有来自大学.政府实 ...

  4. CAT部署集成文档

    1. 下载编译 1.1 下载源码 首先,到项目的git网页下载整个项目: https://github.com/dianping/cat 1.2  打包安装 接着就是进入这个项目的目录,运行打包安装命 ...

  5. kuangbin专题16D(next求最小循环节)

    题目链接: https://vjudge.net/contest/70325#problem/D 题意: 给出一个循环字符串, 可以在两端添加任意字符, 问最少添加多少字符可以使循环字符串变成周期循环 ...

  6. iOS10 新特性-新功能,以及ReplayKit库

    iOS的10.0 本文总结了iOS的10,运行于目前推出iOS设备推出的主要开发者相关的功能. iOS版10引入了新的方法来增加您的应用程序通过帮助系统参与在适当的时候建议你的应用程序给用户.如果你在 ...

  7. 浅谈python web框架django2.x

    1.Django简介 Python下有多款不同的 Web 框架,Django是最有代表性的一种.许多成功的网站和APP都基于Django. Django是一个开源的Web应用框架,由Python写成. ...

  8. dorado中的视图实现类和监听器

    视图模型实现类(DefaultViewModel.java)的主要功能:  1. Dataset的初始化以及数据导入  2. 各种View组件的初始化工作 DefaultViewModel也是动态创建 ...

  9. zabbix监控nginx进程

    确认nginx有没有安装模块 然后在主站点下添加(二级站点) location /NginxStatus { stub_status on; access_log off; allow 127.0.0 ...

  10. JEECG入门

    姓名:陈中娇    班级:软件151 1.准备: 下载Jdk1.6+.myeclipse.tomcat6.0.MySQL数据库.jeecg-framework压缩包 2.安装:①.安装jdk,配置好环 ...