使用带有sqlite的实体框架 [英] Using entity framework with sqlite

查看:51
本文介绍了使用带有sqlite的实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用Entity Framework的新手,并且在SQLite上使用 Entity Framework 5 - Brice's博客 [ ^ ]作为起点。我在另一个代码项目页面上看到了它作为链接(使用实体的SQLite CRUD操作框架7 [ ^ ])。



我所做的唯一变化是使用Windows窗体应用程序而不是控制台并添加缺少的使用语句。我正在使用Visual Studio 2015社区,并尝试过使用framemwork 4和4.6.1。



所有似乎都适合开始编码部分。当我在添加第一个代码块后运行应用程序时,我收到以下错误:



没有找到具有不变名称'System的ADO.NET提供程序的实体框架提供程序.Data.SQLite。确保提供程序已在应用程序配置文件的entityFramework部分中注册。请参阅 Entity Framework 6(EF6)提供商 [ ^ ]获取更多信息。



微软的文章确实如此没有帮助我。



谁能帮我理解什么是错的?



我是什么尝试过:



尝试使用框架4和4.6.1。尝试作为控制台和WinForms应用程序。

解决方案

实体框架5 - Brice的博客 [ ^ ],在开始编码之前,您必须安装Entity Framework Controller和Provider。您必须从NuGet包下载它们 [ ^ ]。



附加信息,您将从这里获得:使用SQLite与Entity Framework 6和存储库模式|软件工程 [ ^ ]


不幸的是我仍然不能使用EF来使用SQLite。



根据获取实体框架,它需要Microsoft Web开发人员工具或Microsoft SQL Server数据工具,似乎是在Visual Studio社区版中。



我试过实体框架 7 < - / span>



并得到与以前不同的错误。


I am new to using Entity Framework and am using Entity Framework 5 on SQLite - Brice’s Blog[^] as a starting point. I came across it as a link on another Code Project page (SQLite CRUD Operation Using Entity Framework 7[^] ).

The only variations that I have made is to use a Windows Form application instead of a Console and add missing ‘using’ statements. I am using Visual Studio 2015 Community and have tried with framemwork 4 and 4.6.1.

All seems to go okay up to Start Coding section. When I run the app after adding the first block of code I get the following error:

No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SQLite'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See Entity Framework 6 (EF6) Providers[^] for more information.

The Microsoft article does not help me any.

Can anyone help me understand what’s wrong?

What I have tried:

Tried with framework 4 and 4.6.1. Tried as a Console and WinForms app.

解决方案

As is stated in Entity Framework 5 on SQLite - Brice’s Blog[^], before you start coding, you have to install Entity Framework Controller and Provider. You have to download them from NuGet package[^].

Additional information, you'll get from here: using SQLite with Entity Framework 6 and the Repository Pattern | Software Engineering[^]


Unfortunately I still cannot EF to work with SQLite.

According to Get Entity Framework it needs Microsoft Web Developer Tools or Microsoft SQL Server Data Tools which do seem to be in Visual Studio Community Edition.

I tried

CodeFirst with SQLite using Entity Framework 7


and get a different error than before.


这篇关于使用带有sqlite的实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆