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: Show Example Scenario 1Install SQL Server 2008 R2 (this installs the 32-bit version of SQL Server Compact 3.5 SP2).Then, when you run a 64-bit application privately deploying SQL Server Compact SP1, It fails with the “Version Mismatch" exception. Reason for the failure
Example Scenario 2
Reason for failure
ResolutionAt any given point of time, the correct state of a 64-bit computer, for SQL Server Compact, would be the following:
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/download/details.aspx?familyid=E497988A-C93A-404C-B161-3A0B323DCE24&displaylang=en StatusMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. Need more help?Want more options?Explore subscription benefits, browse training courses, learn how to secure your device, and more. Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge. ....................................................................................................................32.1.1 HRESULT Values.....................................................................................................6 2.2 Win32 Error Codes......................................................................................................167 2.3 NTSTATUS ...................................................................................................................357 2.3.1 NTSTATUS values....................................................................................................358 Note : You may have to translate signed decimal code value into hex. Example: -1073741515 is 0xC0000135. Use Windows Calculator for that. 2 2.1 HRESULT http://msdn.microsoft.com/en-us/library/cc231198(v=prot.10).aspxThe HRESULT numbering space is vendor-extensible. Vendors can supply their own values for this field, as long as the C bit (0x20000000) is set, indicating it is a customer code.The HRESULT numbering space has the following internal structure. Any protocol that uses NTSTATUS values on the wire is responsible for stating the order in which the bytes are placed on the wire.0123 4567891012345678920123456789301SRCNXFacilityCodeS (1 bit): Severity. If set, indicates a failure result. If clear, indicates a success result.R (1 bit): Reserved. If the N bit is clear, this bit MUST be set to 0. If the N bit is set, this bit is defined by |