MVC3音乐商店教程连接字符串问题 [英] MVC3 Music Store Tutorial Connection String issue

查看:71
本文介绍了MVC3音乐商店教程连接字符串问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过MVC音乐商店教程我的方式和我运行到一个问题,当我尝试连接到使用实体框架模型数据库。我已经尝试了许多这样的演练,而且我不断遇到问题时,我得到这个部分。

I'm working my way through the MVC Music Store Tutorial and am running into an issue when I try to connect to the database using the entity framework model. I've tried a number of these walkthroughs, and I'm continuing to run into problems when I get to this part.

我不希望使用SQL精简版(虽然我试着安装它只是为了让辅导工作)。相反,我有SQL Server开发人员2005版以及SQL2008前preSS的命名实例(同样,刚刚安装,看看我能得到的教程工作)。这是我的连接字符串:

I do not want to use SQL Compact Edition (although I've tried to install it just to get the tutorials to work). Rather, I have SQL Server Developer 2005 Edition as well as a named instance of SQL2008 Express (again, installed just to see if I could get the tutorial to work). Here is my connection string:

<connectionStrings>
<add name="MusicStoreEntities"
     connectionString="server=2-BQZ5DP1\DELS2008EXPRESS;Integrated Security=SSPI;database=MvcMusicStore"/>
</connectionStrings>

结束标记的是connectionStrings元素不会在code片段后,所以pretend它的存在。

The closing tag for the connectionStrings element will not post in the code snippet, so pretend that it is there.

什么是我需要做不同? 2 BQZ5DP1是我框的名称和SQL防爆preSS实例是命名实例。

What do I need to do differently? 2-BQZ5DP1 is the name of my box, and the SQL Express instance is a named instance.

推荐答案

您一般需要MultipleActiveResultSets = TRUE与实体框架时,您使用的是紧凑型其他SQL Server版本。根据你所看到的错误,这可能是你的问题。欲了解更多有关连接字符串选项,请参阅本博客:

You generally need MultipleActiveResultSets=True with Entity Framework when you're using SQL Server editions other than Compact. Depending on what the error you are seeing is, that might be your problem. For more on connection string options, see this blog:

<一个href=\"http://blogs.msdn.com/b/aspnetue/archive/2012/08/14/sql-server-connection-strings-for-asp-net-web-applications.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/aspnetue/archive/2012/08/14/sql-server-connection-strings-for-asp-net-web-applications.aspx

这篇关于MVC3音乐商店教程连接字符串问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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