Running Sqlite on Mono

Running Sqlite on Mono

It looks like it can't find the entry point in the native sqlite3 binary (sqlite3_open_v2). System.data.SQLLite is a managed ado.net wrapper that interops.

Do you also have the native sqlite3 binaries? They are located here: http://sqlite.org/download.html

EDIT:

Noticed you're using Mono and your download link below points to the windows dll download. Have tried looking at?

http://www.mono-project.com/SQLite

Sqlite leaves connection open (Mono.Data.Sqlite.dll)

I changed connection string to : (Poling=False)

var conString = $"Data Source={dbLocation}; Read Only=True; Pooling=False;";

and I also closed my reader as:

    // using very important!
using(var command = sqlite3.CreateCommand())
{
command.CommandText = "select * from foo";
var reader = command.ExecuteReader();
// etc...

reader.Close(); // close reader! <----- this is very important for some reason
}

This has been running for one hour and the count has not increased. I hope this is the solution.

Mono can't open sqlite database

Figured out my problem here. Apparently instead of using

"Data Source=file:db\\DataWorksProg.s3db"

I should have been using

"URI=file:db\\DataWorksProg.s3db"

Switched to the URI and it works as expected. I had thought from reading the docs that under the 2.0 profile, the DataSource part was needed instead of the URI, but I got the results I'm looking for.

Trouble getting SQLite to run under Mono on Linux

If you're targeting explicitly Mono then use the Mono version of the SQLite connector (never knew why they decided to break the namespace compatibility, but that's how they did it).

Just replace the references and usings from System.Data.SQLite to Mono.Data.SQLite

Unable to use Mono.Data.Sqlite.dll in Visual Studio

In some cases, especially when moving project on a another computer, the following steps can help to prepare environment to compile projects, that require the NuGet Mono.data.sqlite package:

  1. Remove reference to the Mono.Data.sqlite from the project's
    references.
  2. In the Visual Studio go to ToolsNuGet Package Manager
    Manage NuGet Packages for Solution... Then select Browse, find
    Mono.data.sqlite package and install it.
  3. Recompile the solution.


Related Topics



Leave a reply



Submit