views:

848

answers:

4
+1  Q: 

SQLite3 in C#.NET

Hello once again.

I'm trying to use SQLite3 in C#.NET. I've googled around and found some different API's. I also checked SQLite's website for wrappers. I like them, but want to write my own wrapper without using an added dependency. All wrappers I find that don't require an added dependency aren't free.

I'm wondering how one would read from, execute, and write to a sqlite3 database. Is it a socket connection(tcp? udp? etc?)? I've tried searching this answer on google and all I get are library-specific answers. :/ SQLite's website docs aren't much help either.

EDIT: I also found a COM interface while googling, but is that library specific?

Thanks SO! :)

+4  A: 

Have you looked at the System.Data.SQLite library? It's a free ADO.NET library to interact with SQLite and requires nothing else in order to run, since it has the engine built into it.

I've been using it for a while now and find it really easy to work with. It even has a plugin for Visual Studio should you decide to use some strongly-typed tables with it or want to use it to add/create tables.

Dillie-O
hmmm. I remember taking a look at that at one point. I'll re-investigate it now.
Zack
Thanks. I think you helped me clarify what I really wanted. I'll go try google with this clarification. :)
Zack
+1  A: 

If you want to use SQLite in .NET, you should take a look at System.Data.SQLite, which is a ADO.NET provider for SQLite

Philippe Leybaert
+4  A: 

(Answering the "socket connection" question.)

Part of the point of SQLite is that it's an embedded database - there's no server to talk to, you load the library directly into your process and it talks to the file system directly.

Jon Skeet
+1  A: 

System.Data.SQLite is comparatively slower than other providers like SqlClient. I have look into its code.

Now I want to call it throw P/Invoke but not like SQLite provider. It call through P/Invoke every time when ever you access column value through DataReader

Faraz