SQLite basic example SQLite basic example sqlite sqlite

SQLite basic example


The error was because I was using .NET Framework 4.0 . I downgraded to 2.0 and it worked. Sorry for the question. It will be nice to use it with .NET Framework 4.0 though.


Edit:

It actually works with .NET Framework 4.0 I had to add this lines of code to my app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">  <supportedRuntime version="v4.0.30319" sku=".NETFramework,Version=v4.0,Profile=Client" /></startup>

also if you plan to use ado.net in your solution I experience a lot of problems when deploying. Everything worked great under development. If you use ado.net and you plan on deploying your app then include also:

<!--Sqlite configuration so that it works with ado.net--><system.data>  <DbProviderFactories>    <remove invariant="System.Data.SQLite"/>    <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite"      type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />    </DbProviderFactories></system.data>

if you include that last part in your app.config file then you will have to make sure that:

enter image description here

those dll's have to be in your output directory.

if you deploy make sure that you copy those files to the working directory


shouldnt it be {"FailIfMissing", "False"} instead of {"FailIfMissing=False", "False"} ?


Please change the Platform Target for your C# project to Project Settings > Build > Platform Target: Any CPU.

I had a similar error occurred when i tried to run in a x64 machine with SQLite x64 binaries. But worked fine after these settings were changed