Win7 x64 に SQL Server Compact Edition 4.0 をインストールしましたが、Asp.Net とデスクトップ アプリケーションの両方で実行されます。この PC には Visual Studio 2010 SP1 もインストールされています。しかし、私の Server 2008 R2 は、デスクトップ アプリケーションを実行できますが、Asp.Net アプリケーションに対して次のエラーを生成します。
Unable to load the native components of SQL Server Compact corresponding to the
ADO.NET provider of version 8482. Install the correct version of SQL Server
Compact. Refer to KB article 974247 for more details.
SqlDataSource と SqlCeConnection の両方を試しました。同じエラー。私のweb.configは以下のようなものです:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="SQLCE" connectionString="Data Source=|DataDirectory|\a.sdf"
providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.SqlServerCe, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</assemblies>
</compilation>
</system.web>
</configuration>
また、ここで提案されているようにdllをコピーしようとしましたが、効果はありません。