svick
svick

Reputation: 244817

Dynamic LINQ with other databases

Are there any free (gratis) providers for databases other MS SQL (e.g. MySQL or SQLite) that work with LINQ and support dynamic SQL query generation? E.g. table.Count() generates something like SELECT COUNT(*) FROM table and doesn't first load the whole table and then count the rows.

Upvotes: 1

Views: 541

Answers (3)

Ronald
Ronald

Reputation: 1815

Check out ADO.NET Entity Framework. It supports MySQL via ADO.NET data providers and LINQ to Entities (similar to LINQ to SQL). Being a Microsoft tool, it has good Visual Studio integration and support.

Can you also explain why you want to support these databases?

Upvotes: 1

dahlbyk
dahlbyk

Reputation: 77540

NHibernate supports multiple databases and has a recently-released Linq provider.

Upvotes: 0

Robert Harvey
Robert Harvey

Reputation: 180798

Here is the DBLinq project: http://code.google.com/p/dblinq2007/

DbLinq is THE LINQ provider that allows to use common databases with an API close to Linq to SQL. It currently supports (by order of appearance): MySQL, Oracle, PostgreSQL, SQLite, Ingres, Firebird

Whether these providers execute Count() in the way you describe depends on the quality of the provider, I suppose. Presumably some effort is made at optimization.

See also http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

Upvotes: 2

Related Questions