我正在尝试连接到我想与 EF 一起使用的新数据库。不幸的是,我无法建立正确的连接字符串。我是数据库新手,所以请温柔。如果有人能指出我解释 ConnectionStrings 的链接,我将不胜感激。
我的 App.config 看起来像这样: 编辑
<?xml version="1.0" encoding="utf-8"?>
<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=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="Test.Properties.Settings.DatabaseConnectionString"
providerName="System.Data.SqlClient"
connectionString="Server=.\SQLEXPRESS;Database=C:\TestControlling\Controlling.mdf;Integrated Security=True;" ></add>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>