How do I convert SQLite DB files to LINQ ORM files? Is there any utility like SQLMetal.exe?
2 Answers
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");
7 Comments
Sasha
Somrhing wrong. I can not use generated (DbMetal.exe) files with sqlite.phxsoftware.com provider...
Sasha
As I can understand generated with DbMetal.exe(code.google.com/p/dblinq2007) code is incompatible with SQLite provider from sqlite.phxsoftware.com.
Justin Niessner
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");
Sasha
You use System.Data.SQLite.Linq.dll and System.Data.SQLite.dll from sqlite.phxsoftware.com? What do you mean "granted, that's on Mono"?
Justin Niessner
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).
|