Using Sqlite for CSharp...

72 views
Skip to first unread message

Phil Haack

unread,
Aug 11, 2009, 2:19:37 PM8/11/09
to csharp...@googlegroups.com

Sorry for such a n00b question, but I thought someone mentioned ADO.NET provider for this and I can’t seem to find it. I’ve found the ADO.NET ADO Provider project for unmanaged SQLite, but is there an ADO.NET provider for this managed version?

 

If not, do you have a simple sample of how someone would call this using C#? For example, a sample that shows how to do the following:

 

Open Connection

Perform Read

Perform Write

Perform Write with Transaction

Close Connection

 

Would be great.

 

Phil

Noah Hart

unread,
Aug 11, 2009, 5:09:49 PM8/11/09
to Phil Haack, csharp...@googlegroups.com
The Benchmark project has 2 simple classes.

But there is nothing for an ADO.NET provider yet.

If it was made into a dll, then the provider from sqlite.phxsoftware.com
should work with some minor changes.

There are so many direction to go with this ...

Noah

Phil Haack

unread,
Aug 11, 2009, 5:29:15 PM8/11/09
to Noah Hart, csharp...@googlegroups.com
I've been corresponding with the sqlite.phxsoftware.com guy. I can see if he's interested in contributing an ADO.NET provider for C#-Sqlite. Personally, I think such a contribution belongs in *this* project, and not over there.

The license for his ADO.NET provider is Public Domain. So if you think it'd be worth having as a separate csproj library in this project, I'll ask him if he's interested.

Phil

Miguel de Icaza

unread,
Aug 11, 2009, 11:36:39 PM8/11/09
to Phil Haack, Noah Hart, csharp...@googlegroups.com
Hello Phil, Noah,

    Well, to be fair, the author of the existing Sqlite binding for ADO.NET already has an ecosystem going for his ADO.NET provider, and he probably would like to reuse that instead of having to move his code over.   I think he should make the call.  

    Additionally, this means that this group can focus on getting C# Sqlite faster, better, tuned, perfect without worrying about higher-level integration points.

    One last item that is of interest to some of us in the open source world: since ADO.NET is not part of ECMA, we are actually looking for an ADO.NET-less implementation of Sqlite for some Mono-based applications on Unix, so we would like to see C# Sqlite independent of an ADO.NET provider for it.

Jay Beavers

unread,
Aug 12, 2009, 12:12:40 AM8/12/09
to Miguel de Icaza, Phil Haack, Noah Hart, csharp...@googlegroups.com
OK, this all makes sense.  Let's work on core stability and performance for now and come back to the ADO.NET/Linq issue later.

Miguel, are there similar issues/concerns about writing a Linq provider?

Phil Haack

unread,
Aug 12, 2009, 12:16:01 AM8/12/09
to Miguel de Icaza, Noah Hart, csharp...@googlegroups.com

Great points as always Miguel.

 

Still, ADO.NET is going to be essential to get the vast majority of .NET developers to consider this project, so it’s definitely important. I’ll touch base with him to try and get the ball rolling. It’d probably only take him a couple hours to have it done. J

 

Phil

Tim Anderson (itwriting)

unread,
Aug 12, 2009, 4:57:22 AM8/12/09
to Phil Haack, csharp...@googlegroups.com
From: csharp...@googlegroups.com [mailto:csharp...@googlegroups.com] On Behalf Of Phil Haack
Sent: 11 August 2009 7:20 PM
To: csharp...@googlegroups.com
Subject: Using Sqlite for CSharp...

> do you have a simple sample of how someone would call this using C#?

I based the code in the proof-of-concept Sqlite for Silverlight on the Getting Started C code at sqlite.org. It only calls sqlite3_exec and reads the output, but that's enough to do everything you mentioned.

http://www.itwriting.com/csharpsqlite/silverlight-sqlite.zip

code is in MainPage.xaml.cs

Tim

Reply all
Reply to author
Forward
0 new messages