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
2009-11-04 16:12:13
Somrhing wrong. I can not use generated (DbMetal.exe) files with http://sqlite.phxsoftware.com/ provider...
Sasha
2009-11-04 16:58:12
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
2009-11-04 17:21:50
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
2009-11-04 17:57:40
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
2009-11-05 08:30:21
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
2009-11-05 14:16:42
Maybe my error was that I took DBMetal.exe from DbLinq-0.18.zip? I need to compile last source from svn???
Sasha
2009-11-05 20:34:16
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
2009-11-06 08:04:13
A:
After all the answer is: NO. SQLMetal is the best utility to convert *.sdf (SQLComact) files to *.dbml schema.
Sasha
2009-12-16 16:58:19