views:

13598

answers:

6

I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?

+97  A: 

Yes, you can find a wrapper here:

http://sqlite.phxsoftware.com/

"System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0 provider all rolled into a single mixed mode assembly. It is a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll). Unlike normal mixed assemblies, it has no linker dependency on the .NET runtime so it can be distributed independently of .NET."

It even supports mono.

amdfan
I second this recommendation (sorry, out of upvotes for today!)
John Sheehan
This is an old question but I had to add my $0.02. System.Data.SQLite rocks. It is super refined, stable and commercial grade quality. Best of all, it's 100% managed code and has been released as public domain source code.
Nathan Ridley
Just for consistency, because people is talking about both as different things. In sqlite.phxsoftware.com you are pointed to sourceforge.net/projects/sqlite-dotnet2 for downloading.
yeyeyerman
+4  A: 

http://sqlite.phxsoftware.com/

Ben Hoffstein
+11  A: 

Here are the ones I can find:

Sources:

tjrobinson
+5  A: 

I'd definitely go with System.Data.SQLite (as previously mentioned: http://sqlite.phxsoftware.com/)

It is coherent with ADO.NET (System.Data.*), and is compiled into a single DLL. No sqlite3.dll - because the C code of SQLite is embedded within System.Data.SQLite.dll. A bit of managed C++ magic.

tonyz
+9  A: 

There's also now this option: http://code.google.com/p/csharp-sqlite/ - a complete port of SQLite to C#.

xanadont
A: 

Version 1.2 of Monotouch includes support for System.Data. You can find more details here: http://monotouch.net/Documentation/System.Data

But basically it allows you to use the usual ADO .NET patterns with sqlite.

Juan Miguel García