3

This has been asked before (1, 2), but unfortunately all previous answers are no longer relevant as they are for older version of .NET framework and either do not work anymore, or not supported.

So, my question: Is there a C# wrapper for SQLite that supports .NET 4 etc.

I tried to search but all binarries that I find are either not working, for older versions or commercial :(

As for this ( http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki ), which seems to be what I need it gives me:

Could not load file or assembly 'System.Data.SQLite, Version=1.0.82.0,
Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies.
An attempt was made to load a program with an incorrect format.

I'm using "Precompiled Binaries for 64-bit Windows (.NET Framework 4.0)" for net 4 and for 64 pc.

Community
  • 1
  • 1
NewProger
  • 2,945
  • 9
  • 40
  • 58
  • which of the offered packages did you download ? and how did you install it ? – Yahia Nov 24 '12 at 17:50
  • @Yahia I downloaded "Precompiled Binaries for 64-bit Windows (.NET Framework 4.0)" because I'm using NET 4. And my pc is 64 bit... I don't think that this is incorrect version, but still, it's not working... – NewProger Nov 24 '12 at 17:54
  • try the 32-bit-version and see what happens... – Yahia Nov 24 '12 at 18:01
  • 1
    See also http://stackoverflow.com/questions/2605490/system-data-sqlite-net-4 – Colonel Panic Nov 24 '12 at 18:03
  • @Yahia, nope, still the same. if only I knew what is wrong... – NewProger Nov 24 '12 at 18:07
  • just as a check: try the demo from Devart... if that does not work then there is definitely something wrong with your machine... – Yahia Nov 24 '12 at 18:10
  • @Yahia No, the demo works just fine. So, there shouldn't be any problem, but apparently it still doesn't work. – NewProger Nov 24 '12 at 18:13

4 Answers4

3

In fact, you have found the right place already. You problem may comes from you're using the wrong version of System.Data.SQLite.dll, because there are two of them, one for x86, one for x64.

Try use Nuget instead of downloading it manually.

deerchao
  • 10,454
  • 9
  • 55
  • 60
  • I downloaded "Precompiled Binaries for 64-bit Windows (.NET Framework 4.0)" because I'm using NET 4. And my pc is 64 bit... I don't think that this is incorrect version, but still, it's not working... – NewProger Nov 24 '12 at 17:53
0

The following libraries work fine AFAIK:

Yahia
  • 69,653
  • 9
  • 115
  • 144
0

Comprehensive lists at http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers (under header '.NET Framework') and http://nuget.org/packages?q=sqlite . Unfortunately, neither pages have comments, so YMMV.


I installed the package System.Data.SQLite (x86/x64) but I got the error

Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
  • Yes, but have you tried any of them? None of them works for NET 4. That's the point! Or they are paid... :( – NewProger Nov 24 '12 at 17:52
0

The devart solution comes in 2 versions, one ($$) with support for ef, nhiberate, etc etc support. The other is free and more basic. Edition comparision: http://www.devart.com/dotconnect/sqlite/editions.html

I dont work for them and havent used this specific product, but I have used other of their software(studio for mysql) and been quite satisified.

user542319
  • 403
  • 2
  • 5
  • 14