2

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

2 Answers 2

5

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");
Sign up to request clarification or add additional context in comments.

7 Comments

Somrhing wrong. I can not use generated (DbMetal.exe) files with sqlite.phxsoftware.com provider...
As I can understand generated with DbMetal.exe(code.google.com/p/dblinq2007) code is incompatible with SQLite provider from sqlite.phxsoftware.com.
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");
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"?
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).
|
0

After all the answer is: NO, without additional library.

We can use SQLMetal, but only for *.sdf (SQLComact) files to *.dbml schema.

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.