I am using sqlite database with sqlite.net dll in my application. Namespace is Finisar.sqlite I have problem while inserting entries in to database using transaction, It throws exception at open connection as "unable to open database file".
I google it but solutions are like change connection string. if i follow that process then finisar gives me exception as invalid params.
SQLiteConnection db = new SQLiteConnection(f_strConnStr);
db.Open();
**Valid parameters are:**
Data Source=<database file> (required)
Version=<version of SQLite (2 or 3)> (default: 2)
New=True|False (default: False)
Compress=True|False (default: False)
UTF8Encoding=True|False (default: False)
UTF16Encoding=True|False (default: False)
Cache Size=<N> (default: 2000)
Synchronous=Full|Normal|Off (default: Normal)
DateTimeFormat=ISO8601|Ticks|CurrentCulture (default: ISO8601)
Compatibility=[old-date-format][,old-binary-format] (default: None)
I tried solution like pooling connection string, journal mode = off etc but nothing works for me. even i can not create file which is password protected due to invalid parameter.
I can not add other than this parameters. If anyone having solution regarding this issue please help us.
Thanks in advance.
So a number of things could be going wrong here:
SQLiteConnection
. To remedy #2 you should always access your data like this:
using (SQLiteConnection c = new SQLiteConnection(f_strConnStr))
{
c.Open();
...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.