Using SQLite-net in a WPF Application

I have a little older point when trying to get SQLite to work on a new WPF project. I recently wrote a bunch of Windows Store and Phone projects and always used the same neat SQLite-net implementation , but now I can't do it with my WPF application.

I added SQLite-net via nuget, but I cannot find the version of SQLite3.dll that I can add to the project. When I download it from SQLite.org, I get the following error.

enter image description here

What am I doing wrong? All the tutorials that I find tell me to use System.Data.Sqlite instead, but I don't want to rewrite all my DAL code again

+8
c # sqlite wpf
source share
2 answers

I have earned.

For those who are trying to do this - in particular, trying to get sqlite-NET to work with WPF, and not just with SQLite, you need to:

  • download the precompiled sqlite3.dll binary from http://www.sqlite.org/download.html
  • copy this dll file to the bin folder
  • go to the project properties> build and change the type of CPU to x86 (there is no pre-compiled version of x64 at the time of writing)
+10
source share

You need to download and install the appropriate System.Data.SQLite installation package from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki .

This will install the necessary SQLIte assemblies in your GAC and development-time components for Visual Studio.

For .NET 4.5.1 (VS 2013), the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx451-setup-bundle-x86-2013-1.0.92.0.exe

For .NET 4.5 (VS 2012), the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx45-setup-bundle-x86-2012-1.0.92.0.exe

For .NET 4 (VS 2010), the current link is http://system.data.sqlite.org/downloads/1.0.92.0/sqlite-netFx40-setup-bundle-x86-2010-1.0.92.0.exe

After that, you can add the necessary references to the SQLite assembly in your project.

Here is a screenshot of the SQLite collections in the Add Link dialog box:

enter image description here

0
source share

All Articles