How to use Visual C++ .NET to detect the .NET Framework versions and service packs that are installed on the computer
http://support.microsoft.com/kb/914135
How to build an OLE DB application for SQL Server CE in Visual Studio 2005
http://support.microsoft.com/kb/914174