tags:

views:

328

answers:

2

How do I convert SQLite DB files to LINQ ORM files? Is there any utility like SQLMetal.exe?

+4  A: 

You're looking for DbLinq.

It's an Open Source project that brings LINQ to SQL to other DB platforms.

Pull down the source, compile the project...and then you'll run DbMetal.exe against your SQLite database to generate the *.cs file.

Update

You'll also have to modify any existing connections string and add the DbLinqProvider parameter. For example:

SqliteConnection("DbLinqProvider=Sqlite;Data Source=MyDatabase.sqlite");

Instead of:

SqliteConnection("Data Source=MyDatabase.sqlite");
Justin Niessner
Somrhing wrong. I can not use generated (DbMetal.exe) files with http://sqlite.phxsoftware.com/ provider...
Sasha
As I can understand generated with DbMetal.exe(http://code.google.com/p/dblinq2007/) code is incompatible with SQLite provider from http://sqlite.phxsoftware.com/.
Sasha
That's the provider I use it with (granted, that's on Mono). Make sure your connection string is properly formatted for use with DbLinq. For example...SqliteConnection("DbLinqProvider=Sqlite;Data Source=MyDatabase.sqlite");
Justin Niessner
You use System.Data.SQLite.Linq.dll and System.Data.SQLite.dll from http://sqlite.phxsoftware.com/? What do you mean "granted, that's on Mono"?
Sasha
Yes...but unfortunately I'm not sure what issue you're having. The other option you mightw ant to look in to is using that SQLite provider with Entity Framework (the officially supported Microsoft ORM).
Justin Niessner
Maybe my error was that I took DBMetal.exe from DbLinq-0.18.zip? I need to compile last source from svn???
Sasha
Thank you for help. After all I decide not to use Dblinq and DBMetal. In my opinion it is not ready for use in commercial purpose.
Sasha
A: 

After all the answer is: NO. SQLMetal is the best utility to convert *.sdf (SQLComact) files to *.dbml schema.

Sasha