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:
- Remove reference to the
Mono.Data.sqlite
from the project's
references. - In the Visual Studio go to
Tools
►NuGet Package Manager
►Manage NuGet Packages for Solution...
Then selectBrowse
, findMono.data.sqlite
package and install it. - Recompile the solution.
Related Topics
How to Hook into Hardware Keyboard Events at an Application Level
How Could the New Async Feature in C# 5.0 Be Implemented with Call/Cc
Can You Call a C# Dll from a C Dll
How Get List of Local Network Computers
How to Pass Strings from C# to C++ (And from C++ to C#) Using Dllimport
.Net Decompiler for MAC or Linux
Non-Virtual Interface Design Pattern in C#/C++
How to Get Float Value with SQLdatareader
Code with Undefined Behavior in C#
How to Rewrite Complicated Lines of C++ Code (Nested Ternary Operator)
Perform Button Click Event When User Press Enter Key in Textbox
Why Would C# Processstartinforedirectstandardoutput Cause Xcopy Process to Fail
Sharing Variables Between C# and C++
Is a Finally Block Without a Catch Block a Java Anti-Pattern