C# 为SQL数据库添加连接字符串时,providerName属性应该是什么?

C# 为SQL数据库添加连接字符串时,providerName属性应该是什么?,c#,sql,sql-server,visual-studio-2012,connection-string,C#,Sql,Sql Server,Visual Studio 2012,Connection String,我正在使用Visual Studio 2012和SQL Server 2014 CTP2构建简单的网页(使用C#和razor标记)。到目前为止,可以访问和查看数据库,但用户尝试向其中添加新项目或编辑现有项目时会引发以下错误: The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "Scripts". 作为参考

我正在使用Visual Studio 2012和SQL Server 2014 CTP2构建简单的网页(使用C#和razor标记)。到目前为止,可以访问和查看数据库,但用户尝试向其中添加新项目或编辑现有项目时会引发以下错误:

The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "Scripts".
作为参考,这是我的_Layout.cshtml文件

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8" />

    <title>@ViewBag.Title</title>

    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery-1.8.2.min.js")"></script>
    <script src="@Url.Content("~/Scripts/modernizr-2.6.2.js")"></script>
</head>

<body>
    <ul id="menu">
        <li>@Html.ActionLink("Home", "Index", "Home")</li>
        <li>@Html.ActionLink("Movies", "Index", "Movies")</li>
        <li>@Html.ActionLink("About", "About", "Home")</li>
    </ul>

    <section id="main">
        @RenderBody()
        <p>Copyright W3schools 2012. All Rights Reserved.</p>
    </section>

</body>
我有一种感觉,我只是在providerName属性末尾的版本号有误,但我无法找到需要将其更改为哪个版本,我尝试了大量的数字,但没有效果


我是这个框架的新手,所以请温柔一点:)

已经定义的以下部分与连接字符串无关

您的_layout.cshtml中缺少一个
@RenderSection(“脚本”,必需:false)


在任何视图中,都可能定义了
@节脚本{}
。您必须从视图中删除
@section脚本{}
,或者将
@RenderSection()
添加到_layout.cshtml。

您尝试过
providerName=“System.Data.SqlClient”
了吗?
<add name="MovieDBContext" connectionString="Data Source=|DataDirectory|\Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/>
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)