I'm trying to access a SpatiaLite from C# using System.Data.SQLite provider. When I try to load the SpatiaLite extension, I always get the
System.Data.SQLite.SQLiteException: SQLite error
The specified module could not be found.
error, even though the spatialite's dll has been copied to the bin directory. I even tried specifying the absolute path to the dll, but to no avail.
Here's the code:
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();
}
...
From this link I get the impression this should work.
Thanks in advance