System.Data.SQLite プロバイダーを使用して C# から 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();
}
...
このリンクから、これはうまくいくはずだという印象を受けます。
前もって感謝します