2
votes

I've installed the latest version of SQLite provider for .Net 4.5 by downloading the file named sqlite-netFx45-setup-bundle-x86-2012-1.0.94.0.exe from SQLite downlaod page to get support with Entity Framework 6 and Design time in Visual studio 2012. After the install is succeeded i'm able browse or create a new sqlite dabase when i use Server Explorer in visual studio however, the SQLite provider doesn't appear when i use the Generate databse wizard of model designer.

1 - From Visual Studio Server Explorer

I Add a connection

enter image description here

enter image description here

I Can see SQLite Provider clearly :

enter image description here

Test Connection succeeded

enter image description here

And finally the database is created without any problem

enter image description here

2 - From Model Diagram Designer :

I've an entity, and want just to generate a database from the model:

enter image description here

The Sqlite provider doesn't appear in providers list

enter image description here

Of course i install the SQLite packages from Nuget, and i Tried to re-install everything in still get the same problem, i googled for 2 days, however i was unable to find a solution.

Thanks.

1
Did you see my reply here stackoverflow.com/questions/25870045/… ? - ErikEJ
@ErikEJ Thanks, yuor solution works correctly and now the SQLite provider is listed, however when generating SQL code for generated database visual studio shows an error as in this screenshot : i.stack.imgur.com/1I2qz.png - SomeCode.NET
@cYounes - you need to set the correct template that generates SQL. At the moment you are using Sql Server specific template for SqlLite. Open the edmx and display properties. In the properties change the 'SsdlToSQL10.tt` to the SqlLite specific .tt (I don't know what it is though) - Pawel
@cYounes in addtion to Pawels coments, see the comments in the linked question... - ErikEJ
@Pawel In the folder C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen i've only the SsdlToSQL10.tt file, i tried to search on the web for another template named as SsdlToSQlite but not found. - SomeCode.NET

1 Answers

0
votes

I was battling with this problem for more than 12 hours, but i later found a very simple solution to it by doing the following:

  1. Write click on the Solution Explorer
  2. Write click on the Reference
  3. Add new Reference
  4. Then Select System.Data.Entity
  5. and Press OK.

Doing this solves my problem.

Good luck