简体   繁体   English

SQLite连接字符串无法识别的C#?

[英]SQLite Connection string unrecognized C#?

I'm trying to connect to SQLite database but the connection string is not recognized and gives me this error. 我正在尝试连接到SQLite数据库,但无法识别连接字符串,这给了我这个错误。 This database file is in my project folder along with other files and for the copy option, I have "copy always" in the debug folder. 该数据库文件与其他文件一起位于我的项目文件夹中,并且对于复制选项,我在调试文件夹中具有“始终复制”。 The error is this: 错误是这样的:

"valid parameters: Data Source = ..." “有效参数:数据源= ...”

Code is: 代码是:

SQLiteConnection con = new SQLiteConnection("Data Source=db.sqlite;version=3;");

What could be wrong? 有什么事吗

SQLiteConnection con = new SQLiteConnection("Data Source=" + System.Windows.Forms.Application.StartupPath + "\\db.sqlite;Version=3;");

指定数据库在驱动器中的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM