2

I am testing my simple aspx web form and I get the above error. It worked before I added SQL CE 4. Below is my web.cofig file:

<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>

How do I add SQL CE 4?

4

1 回答 1

5

我可以建议的一件事是确保将 dllSystem.Data.SqlServerCe设置Copy Local为 true 并尝试重新部署。

于 2013-06-07T12:08:32.680 回答