<assemblies>
<add assembly="System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=DB937BC2D44FF139"/>
</assemblies>
<connectionStrings>
<add name="SQLiteService" connectionString="Data Source=|DataDirectory|Your.db;Version=3;" providerName="System.Data.SQLite"/>
</connectionStrings>
protected void Page_Load(object sender, EventArgs e)
{
string sqliteFilePath = Server.MapPath("~/App_Data/Your.db");
using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + sqliteFilePath))
{
using (SQLiteCommand comm = conn.CreateCommand())
{
conn.Open();
comm.CommandText = "select * from [YourData]";
SQLiteDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
Response.Write("Id " + System.Convert.ToString(dr["Id"]) + "<br />");
}
}
}
}
留言列表