我正在测试我的简单aspx Web表单,我收到上述错误。它在我添加SQL CE 4之前有效。下面是我的web.cofig文件:
<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=|DataDirectory|\Database.sdf" providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true">
</compilation>
</system.web>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
</configuration>
如何添加SQL CE 4?
答案 0 :(得分:5)
我可以建议的一件事是确保将System.Data.SqlServerCe
设置为Copy Local
为真,并尝试重新部署。