【发布时间】:2020-11-23 05:22:56
【问题描述】:
我正在开发带有 sqlite 数据库的 Windows 应用程序 .net 2.0,我的连接字符串保留在 app.config 中
<connectionStrings>
<add name="SQLiteDB"
connectionString="Data Source=|DataDirectory|database.s3db;version=3;password=mypassword;"
providerName="System.Data.Sqlite"/>
</connectionStrings>
在连接字符串中,我将密码定义为“mypassword”,如果我删除此密码,一切正常,但是当我使用密码子句时,它在 connection.open() 语法中出现错误
File opened that is not a database file
file is encrypted or is not a database
我在网上搜索并发现了一些版本问题,但我只使用版本 3,正如我在连接字符串中所述,我还尝试删除“version=3”,但问题仍然存在。
我是第一次这样做,有什么解决办法?
【问题讨论】:
-
我收到此错误消息是因为我尝试使用
sqlite打开 db 文件,但我应该使用的是sqlite3。
标签: c# winforms visual-studio-2010 sqlite