无法读取sqlite数据库,在visual studio 2013中使用实体框架
本文关键字:2013 框架 实体 studio visual 读取 sqlite 数据库 | 更新日期: 2023-09-27 18:10:39
在参考了几乎所有与这个问题相关的问题之后。我找不到解决这个问题的方法。
我遵循了上面提到的所有步骤。
1)从sqlite.org下载包
2)从nuget
实体模型向导的数据源列表中仍然没有出现sqlite
我的app.config是这样的。
<?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.1" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.Linq, Version=1.0.98.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
<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>
我已经尝试了几乎任何东西,但未能获得使用实体框架连接到sqlite所需的基本步骤,然后读取数据库。
我已经创建了数据库使用数据库浏览器的sqlite,这是通过简单的ADO访问。净方法。
一旦sqlite显示在数据源下,然后。提供程序错误在那里。例如
No-Entity-Framework-provider-found-for-the-ADO-NET
有人可以帮助我从设置环境开始的完整步骤,直到在visual studio 2013, . net 4.5.1, wpf, mvvm中对sqlite数据库执行操作。
尝试按照此链接中的详细信息操作
using sqllite with EF
获取安装文件,这些文件在wiki中有一个指向
的链接。设置文件,应该为您注册所有内容
好了,我们来看看。net bundle的设置,它注册了DLL,运行得很好,所以你应该完成这个设置,应该可以运行