Sasha
Sasha

Reputation: 1978

Convert SQLite DB files to "LINQ to SQL" like SQLMetal.exe

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

Upvotes: 2

Views: 1829

Answers (2)

Sasha
Sasha

Reputation: 1978

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

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

Upvotes: 0

Justin Niessner
Justin Niessner

Reputation: 245389

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");

Upvotes: 5

Related Questions