C# SQL Server CE引发不兼容异常

C# SQL Server CE引发不兼容异常,c#,sql,sql-server-ce,C#,Sql,Sql Server Ce,我的申请被打开并立即关闭。它给出了以下错误: 应用程序正在尝试加载版本5692的本机组件,这些组件与版本8080的ADO.NET提供程序不兼容。不兼容的版本可能导致应用程序不稳定,因此SQL Server Compact的加载已中止。安装SQL Server Compact的正确版本。有关更多详细信息,请参阅知识库文章974247 有什么问题?任何帮助都将不胜感激 我试过SQL Server CE 3.5、3.5 sp2、4.0您试过查看错误消息中提到的知识库文章吗 原因 基于Compact的

我的申请被打开并立即关闭。它给出了以下错误:

应用程序正在尝试加载版本5692的本机组件,这些组件与版本8080的ADO.NET提供程序不兼容。不兼容的版本可能导致应用程序不稳定,因此SQL Server Compact的加载已中止。安装SQL Server Compact的正确版本。有关更多详细信息,请参阅知识库文章974247

有什么问题?任何帮助都将不胜感激


我试过SQL Server CE 3.5、3.5 sp2、4.0

您试过查看错误消息中提到的知识库文章吗

原因 基于Compact的应用程序通常针对Compact ADO.NET提供程序编程 (System.Data.SqlServerCe.dll)。此提供程序依次与 本机紧凑组件。为了避免各种不一致,一个紧凑的 特定版本的ADO.NET提供程序只能与Compact本机对话 相同版本的组件。以下是一些示例场景,其中 这一政策将被打破,这将导致以前的 提到两个例外: 决议 在任何给定的时间点,64位计算机的正确状态,例如SQL 服务器紧凑型,将如下所示: x86和amd64 MSI都已安装。 x86和amd64 MSI的版本相同。 因此,如果您遇到任何类似的问题,请确保计算机同时具有这两种功能 已安装Compact的x86和amd64 MSI,它们的版本相同。 如果不是,则从以下位置安装Compact SP2 x86和x64 MSI 根据需要链接: http://www.microsoft.com/downloads/details.aspx?familyid=E497988A-C93A-404C-B161-3A0B323DCE24&displaylang=en
回答得好,x86和x64都安装了。但我不确定这些是否会造成问题。现在我正在看文章并做你的提示。@ MuStu-如果它对你有帮助,请考虑把它标记为答案。这有助于其他可能偶然发现该问题的用户看到该问题的有效解决方案。顺便说一下,你的其他问题也是如此。 CAUSE Compact based applications generally program against the Compact ADO.NET provider (System.Data.SqlServerCe.dll). This provider in-turn communicates with the native Compact components. In order to avoid various inconsistencies, a Compact ADO.NET provider of a certain version can talk only to the Compact native components of the same version. The following are some sample scenarios where this policy will be broken, and that will result in one of the previously mentioned two exceptions: Resolution At any given point of time, the correct state of a 64-bit computer, for SQL Server Compact, would be the following: Both x86 and amd64 MSIs are installed. Both x86 and amd64 MSIs are of the same version. Therefore, if you face any similar issues, make sure that the computer has both x86 and amd64 MSIs of Compact are installed and they are of the same version. In case, they are not, then install Compact SP2 x86 and x64 MSIs from following link as needed: http://www.microsoft.com/downloads/details.aspx?familyid=E497988A-C93A-404C-B161-3A0B323DCE24&displaylang=en