2
我在VS2012上启动了一个MVC项目,创建了我的模型,我的控制器和我的视图。我首先使用实体框架代码,所以我启用了迁移,并根据代码中的更改相应更新数据库。 页面运行正常,数据库正常工作,数据正在被检索,因此它的功能,一切都很好。SQL Server对象资源管理器不显示我的数据库
的问题是,我看到在我的web.config中没有连接字符串:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
也不做数据库的SQL Server的对象资源管理器中显示出来...... 我已经检查this answer,但我的对象浏览器中的服务器已经是正确的了。
没错,就是这样,谢谢你的提示。 –