views:

131

answers:

2

I'm fairly new to LINQ and trying to find a more elegant way (other than ADO.Net) to query and manipulate data in a SQLite database. I'm using System.Data.SQLite and wondering if there is a DataContext class or a way to use DataContext class to work with SQLite.

I believe LINQPad uses the same assembly for its SQLite/MySQL driver and with it I can execute C# expressions like so:

from c in Collection
where c.Length > 3
select c

What can I do to use those same LINQ expressions with my SQLite databases in my applications?

A: 

Basically, Linq-to-SQL as is only support SQL Server as its backend.

You need to look at some third-party extension, like:

Those additional tools allow you to use Linq-to-SQL against a variety of backend database stores, including SQLite.

marc_s
+1  A: 

System.Data.SQLite supports the ADO.NET Entity Framework, so you should be able to just add an Entity Framework mapping and point it to your SQLite connection.

http://sqlite.phxsoftware.com/sqlite.wmv

Stephen Cleary