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?