“在 DLL sqlite3 中找不到入口点 sqlite3_open_v2” 使用 System.Data.Sqlite 时
我在通过 System.Data.Sqlite 连接到 Sqlite 数据库时遇到问题。 我试图使用 FluentNhibernate 但这不起作用,所以我回到基础知识但得到了同样的错误:无法在 DLL sqlite3 中找到入口点 sqlite3_open_v2。
这是我的(我认为相当简单)代码:
using (SQLiteConnection connection = new SQLiteConnection("Data Source=Stripper.s3db;Initial Catalog=main;"))
{
using (SQLiteCommand cmd = new SQLiteCommand("select * from album", connection))
{
cmd.Connection.Open();
object t = cmd.ExecuteScalar();
cmd.Connection.Close();
}
}
我引用了 System.Data.SQLite,所以一切对我来说都很好。 互联网上的一些解释(你几乎不能称之为教程)并没有帮助我。
I am having problems connecting to a Sqlite database through System.Data.Sqlite. I was trying to use FluentNhibernate but that didn't work, so I went back to basics but got the same error: Cannot find entry point sqlite3_open_v2 in DLL sqlite3.
This is my (fairly simple I believe) code:
using (SQLiteConnection connection = new SQLiteConnection("Data Source=Stripper.s3db;Initial Catalog=main;"))
{
using (SQLiteCommand cmd = new SQLiteCommand("select * from album", connection))
{
cmd.Connection.Open();
object t = cmd.ExecuteScalar();
cmd.Connection.Close();
}
}
I have a reference to System.Data.SQLite so everything seems fine to me. The few explanations (you can barely call them tutorials) on the internet haven't helped me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它可能是您正在使用的 Sqlite3 版本。 V2 方法相对较新 - 在 v3.5 中引入
It may be the version of Sqlite3 you are working against. The V2 methods are relatively new - introduced in v3.5
另一种可能的解释是您在 64 位应用程序中使用了 32 位版本的提供程序。
Another possible explanation is that you're using a 32 bit version of the provider in a 64 bit application.
我刚刚从 System.Data.Sqlite 网站 (sqlite.phxsoftware.com/) 下载了 v1.0.60.0,这导致 http://sourceforge.net/project/showfiles.php?group_id=132486。 正如你所看到的,没有太多选择,所以我不认为我做错了什么。 如果我没记错的话,Sqlite3 包含在 System.Data.Sqlite 中,因此人们会期望它是一个好的版本。
我确实在 32 位应用程序上使用 32 位版本。
我已经下载了安装程序并将尝试使用它(我正在使用二进制文件)。
I just downloaded v1.0.60.0 from the System.Data.Sqlite website (sqlite.phxsoftware.com/) which leads to http://sourceforge.net/project/showfiles.php?group_id=132486. As you can see there isn't much choice, so I can't think I'm doing anything wrong there. If I am not mistaken, Sqlite3 is included in System.Data.Sqlite so one would expect it to be the good version.
I am definitely working with the 32bit version on a 32bit application.
I have downloaded the installer and will try with that (I was using the binaries).