如何使用EF在SQLite中启用迁移

编程入门 行业动态 更新时间:2024-10-15 12:29:27
本文介绍了如何使用EF在SQLite中启用迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我陷入了问题。我正在为Windows桌面应用程序编写代码,并且必须使用sqlite作为数据库。我已经从nuget包中成功安装了 system.data.sqlite 和实体框架。我还创建了DbContext类。现在的问题是,一旦我尝试运行代码,就会出现异常,其内部消息是

I have stuck in problem. I am writing a code for windows desktop application and I have to use sqlite as a database. I have successfully installed system.data.sqlite and entity framework from nuget package. I have also created my DbContext class. Now problem is that as soon as I tried to run my code an exception comes whose inner message is

{ SQLite错误1:'否这样的表:TimeSheet'}。

{"SQLite Error 1: 'no such table: TimeSheet'"}.

这意味着您的表TimeSheet在数据库中不存在。请告诉我如何使用实体框架在sqlite中创建表或如何启用迁移。

This means your table TimeSheet does not exist in database. Plz tell me how to create table in sqlite using entity framework or how to enable migrations.

推荐答案

SQLite。

github/bubibubi/db2ef6migrations 基于新的EF6迁移接口,但有一些限制。 您可以从Nuget下载它,搜索System.Data.SQLite.EF6.Migrations

github/bubibubi/db2ef6migrations is based on the new EF6 migration interface but it has some restrictions. You can download it from Nuget searching for System.Data.SQLite.EF6.Migrations

更多推荐

如何使用EF在SQLite中启用迁移

本文发布于:2023-11-16 23:02:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607855.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   EF   SQLite

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!