Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite connection not appearing in Entity Data Model Wizard

What i did to get where i am: I installed the assembly from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki using the GAC and VS2012 options.

I can now make a connection to an existing SQLite datebase or make a connection and create a new SQLite database file.

This connection will appear in my server explorer and works fine. I can look in this database from the explorer and change tables and so on.

However, when i try to add a new ADO.NET Entity Data Model this already made connection will not appear in the available data connections. Even if i then proceed in making a new connection, the System.Data.SQLite Database File option is not even in the list of options.

I have tried installing the entity package with NuGet separately or together with the SQLite packages. I have tried not installing them or only the Entity model in combination with the previously mentioned assembly, but the option for SQLite just won't appear.

After having googled and overflowed this for a frustrating amount of time and having found only a handfull of people that display the same problem as me but with no solution that works for me i come to you for help.

After all my efforts, I suspect it comes down to my App.config file. Mine looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite.EF6" />
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>
  </system.data>
</configuration>

similar problems:

Database first create entity framework 6.1.1 model using system.data.sqlite 1.0.93

http://sqlite.1065341.n5.nabble.com/Provider-not-showing-up-in-Net-Model-import-wizard-td75306.html

I used vs2012 .NET 4.5, SQLite version 1.0.96.0, entity 6.1.3

I hope someone will be able to help me.

like image 447
ImP Avatar asked Mar 26 '15 22:03

ImP


People also ask

Does Entity Framework work with SQLite?

This database provider allows Entity Framework Core to be used with SQLite. The provider is maintained as part of the Entity Framework Core project.

How do I add SQLite to Visual Studio?

Open Visual Studio, select new project, and, in Visual C#, select “Console Application” and provide the name as SQLiteDemo. Click OK. To connect SQLite with C#, we need drivers. Install all required SQLite resources from the NuGet package, as pictured in Figure 1.

What is SQLite connection?

SQLite is a C library that provides a lightweight disk-based database that doesn't require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language.

How do I add models to Entity Framework?

Right-click the Models folder in the Solution Explorer window and select the menu option Add, New Item. In the Add New Item dialog, select the Data category (see Figure 1). Select the ADO.NET Entity Data Model template, give the Entity Data Model the name MoviesDBModel. edmx, and click the Add button.


1 Answers

Install the Entity Framwork 6.1.3 Tools - download from here: http://www.microsoft.com/en-us/download/details.aspx?id=40762

like image 146
ErikEJ Avatar answered Oct 02 '22 22:10

ErikEJ