views:

9844

answers:

7

I have a small project that require a storage (I choose SQLite) and I got good result with the ADO DLL for .Net for Sqlite.

After the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I would like to know if anyone got any good result with SQLite and LINQ?

*If linqtosql work the same way what ever the SQL database, let me know it. I was interesting with the Dll when I saw it because I never use Linqtosql before and I thought it would be a great opportunity to try,

A: 

Assuming you have all the references added, using the correct Data Adapters, LINQ is a viable and good option for you.

websch01ar
+3  A: 

This isn't an answer to your question as such, but as an alternative you could use SQL Compact:

http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx

Which has good LINQ-to-SQL support, and (despite the name) is great for desktop apps with small storage requirements.

stusmith
+1 I will keep Sqlite but you learn me something new with Compact!
Daok
+3  A: 

LINQ to SQL only supports SQL Server/Compact however it is possible the SQLite people have written their own LINQ provider given the name of the assembly.

If that's the case you would be able to use the LINQ query syntax by adding a reference to it but you wouldn't get LINQ to SQL specific features such as the DataContext/designer/SQL Metal/Column attributes/EntitySet/EntityRef etc.

DamienG
Alright thx for the information. I'll mark you as answer if by the end of the day no one have a better answer ! +1
Daok
+16  A: 

I've recently discovered DBLinq, which supports SQLite among other DB:

Ricky AH
this one should be the answer, it's the only LINQ<->SQLite that I've found that looks good
jcollum
Except it's still in CTP.
jcollum
It's the only LINQ to SQL provider to databases other than SQLServer that i've found
Ricky AH
I changed the answer. Back in the time it this answer wasn't there but now it's obviously the best one.
Daok
+2  A: 

I my recent project I have used SQlite to save application data. It worked great for me. I could retrieve, filter and save data using only LINQ and C# code without using any SQL constructs.

Here you can download my tiny Visual Studio 2008 test project, where the C# code retrieves data from SQlite file database:

http://www.nik.xail.net/TestSQlite.rar

(copy the link and past it to you browser address field)

  • Launch the program TestSQlite.exe to see some data retrieved from DB.
  • Get a free SQlite GUI administration tool to easily create new tables, columns etc.
  • Explore the code
nikolai
Thank you. I will check it soon.
Daok
-1 broken link (stupid 15 characters comment limit HATE HATE HATE)
romkyns
@romkyns: can't you read? **"copy the link and past it to you browser address field"**
Bruno Reis
@Bruno Regardless, the link is still broken.
bzlm
@bzlm: I'd expect that... have you noticed this answer's date?
Bruno Reis
@Bruno Answers here are supposed to be timeless. :) Flagging to remove.
bzlm
A: 

this is a good linq to sqlite..

http://www.devart.com/dotconnect/sqlite/

Matt Peters
+2  A: 

From my own experience, Microsoft SQL Compact Framework is a REAL NO-GO. It is REALLY FREAKING slow and its Query Analyzer is just really poor. I had to ask my team to rewrite all the plumbing code of my Windows Mobile component to get rid of the awful performances of SQL CE.

fmarceau