[英]How to create a db3 database with Sqlite-Net
在一個單聲道項目中,我想創建一個數據庫並使用它,並且Sqlite-Net被優化為單聲道,所以就這樣。 但我找不到任何文檔如何用它創建數據庫。 所以我只是嘗試連接到它並希望它會說“數據庫不存在,我將創建一個”但我得到一個例外,以便approch不工作
readonly string _pathToDatabase = "Meter_db.db3";
public InstallMeterRepository()
{
if(!File.Exists(_pathToDatabase))
{
using (var conn = new SQLite.SQLiteConnection(_pathToDatabase))
{
conn.CreateTable<InstalledMeter>();
}
}
}
如果要創建新數據庫,則需要驅動程序: http : //system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
你也可以在這里查看:http:// sqlite.phxsoftware.com/
有了這個FREEWARE經理,你可以用你的數據庫做任何你想做的事情:(推薦!)SQLite2009 Pro企業管理器http://osenxpsuite.net/?xp=3&uid=managementtools
快樂發展!
恐懼
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.