试图让连接单独工作,但是它一直坚持找不到连接。
我的配置文件:
<?xml version="1.0"?>
<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>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<connectionStrings>
<add name="Tank_Analizor_DBEntities" connectionString="metadata=res://*/Analizor.csdl|res://*/Analizor.ssdl|res://*/Analizor.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="data source=|DataDirectory|\DB\Tank_Analizor_DB.sdf"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0"/>
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
尝试直接将路径更改为数据库文件,例如:
<add name="Tank_Analizor_DBEntities" connectionString="metadata=res://*/Analizor.csdl|res://*/Analizor.ssdl|res://*/Analizor.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="data source=C:\Debug\DB\Tank_Analizor_DB.sdf"" providerName="System.Data.EntityClient"/>
但仍然没有运气,这可能是什么问题?