Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created January 26, 2011 14:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sixman9/796766 to your computer and use it in GitHub Desktop.
Save sixman9/796766 to your computer and use it in GitHub Desktop.
How to load libspatialite under C#
//'using' System.Data.SQLite;
using (DbConnection connection = new SQLiteConnection("Data Source=" + database)) {
connection.Open(); // load the extension
using (DbCommand command = connection.CreateCommand()) {
//Load the libspatialite library extension - *.dll on windows, *.a on iOS
command.CommandText = "SELECT load_extension('libspatialite-2.dll');";
command.ExecuteNonQuery(); // Run queries here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment