从数据库错误更新模型。 [英] Update Model from database error.

查看:84
本文介绍了从数据库错误更新模型。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我是c#和asp.net mvc5的新手。

Hello everyone. I'm new in c# and asp.net mvc5.

我遇到错误和错误。

我改变了我的mssql数据库表。在我的表中添加一列。保存后右键单击visual-studio中的模型。我选择"从数据库更新模型"来自"刷新"标签。选择将刷新的表。刷新表后和
运行程序。我遇到错误。

I changed my mssql database table. add a column to my table. After save right-clicked at model in visual-studio. I choose "Update Model from Database" From "Refresh" tab. Select the table which will refreshed. after refresh tables and run the program. I meet errors.

通常

   private PERKONEntities db = new PERKONEntities();

   private PERKONEntities db = new PERKONEntities();

这是我的数据库连接。我使用ADO.NET实体数据模型创建此连接。

it's my database connection. I create this connection with ADO.NET Entity Data Model.

错误     CS0246    找不到类型或命名空间名称'PERKONEntities'(您是否缺少using指令或程序集引用?)     WebApplication1     C:\ Users \lenovo \documents \ visual
studio 2015 \Projects\WebApplication1 \WebApplication1 \Controllers\kullanicisController.cs     15    有效

Error    CS0246    The type or namespace name 'PERKONEntities' could not be found (are you missing a using directive or an assembly reference?)    WebApplication1    C:\Users\lenovo\documents\visual studio 2015\Projects\WebApplication1\WebApplication1\Controllers\kullanicisController.cs    15    Active

任何人都可以帮助我吗?

Can anyone help me?

推荐答案

那么为了使用EF模型,如果EF在另一个项目中,那么项目必须引用它。另外,如果在方法中使用EF,'using'语句必须指向模型。
Well in order to use the EF model, then the project must have reference to it, if EF is in another project. Also if using EF in a method, a 'using' statement must point to the model.


这篇关于从数据库错误更新模型。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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