SqliteConnection And SQLiteConnection throw MissingMethodException

Hi,

I’m having trouble setting up my SQLite database in C# and js.
What I’m trying to do is this.

Then I rebuilt the new SQLiteConnection part in C# (as seen here):

public void OpenDB(string connectionString)
    {

        dbConnection = new SqliteConnection(connectionString);

        dbConnection.Open();

        Debug.Log("Connected to db");

    }

both classes use/import System.Data and Mono.Data.Sqlite.

I’m using the Pro version and have imported both dlls and the sqlite3.dll into the Plugins folder in unity.

According to google and other unity answers this should prevent the following error on runtime:
(points at new SqliteConnection(string connectionString))

MissingMethodException: Method contains unsupported native code
…LanguageSupport._Initialize (.LanguageSupport* )
…LanguageSupport.Initialize (.LanguageSupport* )
Rethrow as ModuleLoadException: The C++ module failed to load.
…LanguageSupport.Initialize (.LanguageSupport* )
…cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for
Mono.Data.Sqlite.SqliteConnection…ctor (System.String connectionString)
(wrapper remoting-invoke-with-check) Mono.Data.Sqlite.SqliteConnection:.ctor (string)
Test.OpenDB (System.String connectionString) (at Assets/JLSGame/Database/Test.cs:60)
Test…ctor (System.String connectionString) (at Assets/JLSGame/Database/Test.cs:39)

then it goes on about where in which file I call the method.

This happens for both the javascript and the C# versions.
The .NET version gives the same error.

anyone knows what I’m missing?

The answer is…
The wrong System.Data.dll was used.

Programming C# .NET is my dayjob, this lead me to believe that System.Data is the .NET library.
It is not. It’s the one converted/build for unity version, found in the same folder as mono.data.sqlite (\Editor\Data\Mono\lib\mono\2.0).