3

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?

2
  • LINQPad uses Matt Warren's IQueryable toolkit for querying SQLite and MySQL. This is one of the few LINQ-to-XXX engines that can reliably translate a wide range of non-trivial LINQ queries into SQL. Commented Aug 19, 2010 at 4:31
  • 1
    By the way, thank you so much for LINQPad. It does so much for my development. It's one of my all time favorite development tools. Commented Aug 19, 2010 at 12:42

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.