不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
C#使用SQLite出错:无法加载 DLL“SQLite.Interop.dll”,找不到指定的模块
编辑:dnawo 日期:2012-03-29
在SQLite官方下载了System.Data.SQLite,编写如下测试代码:
运行出错,在new SQLiteConnection处提示:
引用内容

解决方法
我下载的System.Data.SQLite版本是Precompiled Binaries for 32-bit Windows (.NET Framework 3.5 SP1),这个版本提供了两个zip包:
①.sqlite-netFx35-binary-bundle-Win32-2008-1.0.79.0.zip
引用内容
②.sqlite-netFx35-binary-Win32-2008-1.0.79.0.zip
引用内容
带bundle的表示动态库是按混合模式编译的,在使用的时候只需要System.Data.SQLite.dll就可以了,而不带bundle的则是将非托管部分和托管部分分别编译,System.Data.SQLite.dll不能独立使用,还需要有SQLite.Interop.dll才能使用。
我用的是不带bundle包中的System.Data.SQLite.dll,解决方法是要么手工复制SQLite.Interop.dll和exe放一块(不能用引用),要么换成引用bundle包中的System.Data.SQLite.dll。
相关链接
[1]·System.Data.SQLite Download Page:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
复制内容到剪贴板
程序代码

using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=F:\my.db;Pooling=true;FailIfMissing=false"))
{
using (SQLiteDataAdapter adapter = new SQLiteDataAdapter("select id,total from table1", conn))
{
DataTable table1 = new DataTable();
adapter.Fill(table1);
MessageBox.Show(table1.Rows[0]["total"].ToString());
}
}
{
using (SQLiteDataAdapter adapter = new SQLiteDataAdapter("select id,total from table1", conn))
{
DataTable table1 = new DataTable();
adapter.Fill(table1);
MessageBox.Show(table1.Rows[0]["total"].ToString());
}
}
运行出错,在new SQLiteConnection处提示:

无法加载 DLL“SQLite.Interop.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。

解决方法
我下载的System.Data.SQLite版本是Precompiled Binaries for 32-bit Windows (.NET Framework 3.5 SP1),这个版本提供了两个zip包:
①.sqlite-netFx35-binary-bundle-Win32-2008-1.0.79.0.zip

This binary package features the mixed-mode assembly and contains all the binaries for the x86 version of the System.Data.SQLite 1.0.79.0 (3.7.10) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.
②.sqlite-netFx35-binary-Win32-2008-1.0.79.0.zip

This binary package contains all the binaries for the x86 version of the System.Data.SQLite 1.0.79.0 (3.7.10) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.
带bundle的表示动态库是按混合模式编译的,在使用的时候只需要System.Data.SQLite.dll就可以了,而不带bundle的则是将非托管部分和托管部分分别编译,System.Data.SQLite.dll不能独立使用,还需要有SQLite.Interop.dll才能使用。
我用的是不带bundle包中的System.Data.SQLite.dll,解决方法是要么手工复制SQLite.Interop.dll和exe放一块(不能用引用),要么换成引用bundle包中的System.Data.SQLite.dll。
相关链接
[1]·System.Data.SQLite Download Page:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
评论: 0 | 引用: 0 | 查看次数: 40290
发表评论
请登录后再发表评论!