3

I tried to create linq-to-sqlite dbml using DbLinq but in vain. Each time I get different type of errors. May be I'm somewhere wrong.

Can anyone tell me the step by step procedure to create the dbml file from the Dblinq source code.

3
  • A more useful link: code.google.com/p/dblinq2007 Commented Mar 7, 2010 at 12:15
  • 1
    It will probably help if you let us know what errors you are getting. Commented Mar 7, 2010 at 12:19
  • Windows Error Message: "DbMetal has stopped working". This is what i get. Check my edit also Commented Mar 8, 2010 at 16:42

2 Answers 2

2

You need to provide a /provider:PROVIDER option to DbMetal.exe so that it knows what kind of database you're using, otherwise it assumes you want Microsoft SQL Server.

Furthermore, you can only use the /dbml or /code options, not both at the same time.

Try this command instead:

DbMetal /provider:Sqlite /conn "Data Source=myDb.db3" /code:mycode.cs /namespace:myNS

If that doesn't work, please file a bug at: http://code.google.com/p/dblinq2007/issues/list

Sign up to request clarification or add additional context in comments.

5 Comments

I get this in the command prompt....................... DbLinq Database mapping generator 2008 version 0.17.0.0 for Microsoft (R) .NET Framework version 3.5 Distributed under the MIT licence (linq.to/db/license) >>> Reading schema from DBML file 'Data Source=nwind2009.db3' Press any key to continue . . . my command in run_sqliteMetal is: @echo off bin\DbMetal /provider:Sqlite /conn "Data Source=nwind2009.db3" /dbml:mycode.dbml /namespace:myNS pause
Please try using either 0.19 or trunk. Alternatively, it's a bug while processing your .db3 file; please file a bug.
Still i got no help. Recently i tried 0.20. I get this error now: DbMetal: Access to the path 'G:\' is denied.
What's the full command you're using? It seems rather odd that it would be trying to access G:\. See also: code.google.com/p/dblinq2007/wiki/Installation
@jonp: Thanks for the help. I cleared the old copy and installed a fresh copy of dblinq and it works fine now.
2

Solution:

Steps I followed:

  1. Downloaded the DBLinq 0.20 source code from this Link
  2. Built it.
  3. copied my database and System.Data.SQLite.dll file to src\DbMetal\obj\Debug folder
  4. Used the following codes to create dbml file from db and cs file from dbml file respectively

DbMetal /provider:Sqlite /conn "Data Source=File.db3" /dbml:File.dbml

DbMetal /code:File.cs File.dbml

The procedure is well illustrated in this link -> http://code.google.com/p/dblinq2007/wiki/Installation

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.