1
我想按照這個鏈接以只讀方式打開一個SQLITE數據庫:Connection strings for SQLite開放SQLITE只讀在C#
SQLITE連接字符串
string ConString = string.Format(@"Data Source={0}dbname.s3db;Version=3;New=False;Compress=True;Mode = Read Only;Temp Path={1};"
, System.AppDomain.CurrentDomain.BaseDirectory,TempPath);
using (SQLiteConnection connection = new SQLiteConnection(ConString))
{
//Rerun Exception
connection.Open();
例外:
有效參數:數據源=(必填) 版本=(默認:2)新=真|假 (默認值:Fa LSE)壓縮= TRUE | FALSE(默認:false) UTF8Encoding = TRUE | FALSE(默認:false)
根據Opening A New Database Connection通過設置只讀與SQLITE_OPEN_READONLY
標誌可以以只讀模式打開數據庫模式,但劑量任何一個在c#中完成它?
根據您所提供的鏈接應該是「只讀=真」,而不是「模式=只讀「。 –
@Adrian Faciu:我也試過,但沒有工作。 – KF2