O'Reilly logo

Professional Windows® Embedded Compact 7 by Thierry Joubert, David Jones, Samuel Phung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MANAGED CODE REQUIREMENTS

Note that SQL Compact 4 and the new Sync libraries as installed with Visual Studio 2010 do not run on Compact 7 systems. It is highly recommended that you have a development machine specifically for Compact 7 development with only the 2008 version of Visual Studio installed.

A typical Compact 7 SQL Compact application will be developed as Managed Code, although it can be done as a native application. The Managed Code namespace for SQL Compact classes follows:

System.Data.SqlServerCe

You can add a reference to this:

Right-click on References in Solution Explorer, choose Add Reference, and select System.Data.SqlServerCe from the .NET tab.

Alternatively you can add a reference to SQL Server Compact in Platform Builder located at:

$(_WINCEROOT)\Others\sqlcompact\managed\Retail

Right-click on References in the Solution Explorer and choose Add Reference. Select the Browse tab as in Figure 20-6, browse to that directory, and select file system.data.sqlserverce.dll.

SqlCe Classes

A number of classes are in this namespace. They apply only to a SQL Compact database connection, not a SQL server database connection. Table 20-2 shows a list of the main ones.

TABLE 20-2: Some of the Main SqlServerCe Classes

CLASS USE
SqlCeEngine For creating new database files.
SqlCeConnection To connect to the database file. It is only a reference to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required