SQLite数据库结构如下: Create TABLE admin(username text ,age integer ); 下边用C#演示下如何对SQLite数据库进行记录的增、查、改、删操作: using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SQLite; // 引用System.Data.SQLite public partial class Sqlite : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e){string _connectionString = @"Data Source = F:\mzwucom\bbs\db1.db";string _sql;SQLiteConnection conn = new SQLiteConnection();SQLiteCommand cmd;SQLiteDataReader dr;conn.ConnectionString = _connectionString;conn. Open ();_sql = " insert into admin(username,age) values ( ' user" + (new Random()).Next(1,100) + " ' , 22 )";cmd = new SQLiteCommand(_sql, conn);cmd.ExecuteNonQuery();_sql = " select * from admin";cmd = new SQLiteCommand(_sql, conn);dr = cmd.ExecuteReader(); while (dr. Read ()){Response.Write(dr [ "username" ] .ToString() + "," + dr [ "age" ] .ToString() + " < br /> ");}}} 转载于:https://www.cnblogs.com/cnk8sky/archive/2008/05/30/1210895.html