MVC得到错误 - 创建数据库权限被拒绝 [英] MVC Getting Error - CREATE DATABASE permission denied
本文介绍了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得到错误 - 创建数据库权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文