MVC得到错误

编程入门 行业动态 更新时间:2024-10-19 20:30:35
本文介绍了MVC得到错误 - 创建数据库权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用MVC第一次,运行应用程序时,我得到这个错误。

I am using MVC first time, and I got this error when running the application.

下面是我的步骤。

  • 创建一个新的 MVC 空项目
  • 安装实体框架5.0.0(PM>安装封装的EntityFramework -Version 5.0.0)
  • 在型号 - MovieReview.cs和MovieReviewContext.cs添加两班。
  • MovieReview类是这样

    MovieReview Class is this

    和MovieReviewContext类是这样的

    And MovieReviewContext Class is this

  • 在Controllers文件夹我添加了一个新的控制器,名为HomeController的。这里是。
  • 然后我在谷歌Chrome或IE浏览器上运行。而我得到了我在上面提到的错误。不明白该怎么做。感谢您的帮助。

    Then I run it on Google Chrome or on IE. And I got the error I mentioned on the top. Can't understand what to do. Thanks for any help

    编辑我没有改变任何自动生成的code中的任何文件。

    EDIT I did not change any auto-generated code in any file.

    推荐答案

    尝试添加一个连接字符串在web.config中,像

    Try to add a connection string in the web.config, something like.

    <connectionStrings> <add name="MovieReviewContext" connectionString="Data Source=.; Integrated Security= true; Initial Catalog=MovieReviewContext;" providerName="System.Data.SqlClient" /> </connectionStrings>

    更多推荐

    MVC得到错误

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

    发布评论

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

    >www.elefans.com

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