我正在尝试使用C#提供程序从System.Data.SQLite访问SpatiaLite。当我尝试加载SpatiaLite扩展时,我总是得到
System.Data.SQLite.SQLiteException: SQLite error
The specified module could not be found.错误,即使spatialite的dll已经被复制到bin目录。我甚至尝试指定dll的绝对路径,但无济于事。
代码如下:
string connectionString = @"Data Source=D:\MyStuff\projects\OsmUtils\trunk\Data\Samples\DB\osm.sqlite";
using (SQLiteConnection connection = new SQLiteConnection (connectionString))
{
connection.Open();
using (SQLiteCommand command = connection.CreateCommand())
{
command.CommandText = @"SELECT load_extension('libspatialite-1.dll');";
command.ExecuteScalar();
}
...我从this link那里得到的印象是,这应该是可行的。
提前感谢
发布于 2009-10-12 19:40:16
多亏了sqlite3.exe命令行工具,我发现还需要一些额外的DLL才能运行:
你可以在SpatiaLite's download page上找到这些。只需将它们复制到bin目录即可。
dll更新:libiconv2.dll需要一个额外的
发布于 2011-05-31 17:59:02
我在Java中遇到了完全相同的问题。我为所有依赖的all调用了System.load(),一切都像冠军一样工作!
的
https://stackoverflow.com/questions/1556436
复制相似问题