The APIs available for use with SQL Server Compact 3.5 when you use Microsoft Visual Studio 2008 or Microsoft Visual Studio 2010 as the development environment are:

  • .NET Compact Framework data providers.

    • System.Data.SqlServerCe namespace (for use with SQL Server Compact 3.5).

    • System.Data.Sqlclient namespace (for use with SQL Server).

  • OLE DB provider for SQL Server Compact 3.5 (uses Microsoft eMbedded Visual C++ [eVC++] language).

Visual Studio 2010 is the preferred environment for developing desktop applications. Visual Studio 2008 SP1 is preferred for developing smart device applications. Visual Studio 2010 does not have support for developing smart device applications. For more information, see Installing a Development Environment.

To work with a database, an API does the following:

  1. Opens a connection to the database.

  2. Sets options that control certain behaviors, such as whether cursors will be used, what type of cursor will be used, and whether updates are permitted.

  3. Executes an SQL statement. Optionally, the application can also use program variables to supply parameter values for the executed statement. An application can execute only one statement at a time on each connection, or it can execute several at the same time.

  4. Moves the data values of return codes, output parameters, and result sets into program variables, where they can be used by the application logic. If the statement returns its result set in the form of an XML document, the application can stream that to a component that consumes XML documents.

  5. Disconnects when finished working in the database.

    The programmer must understand both SQL statements and the appropriate use of the database API.

Other Resources

Native Programming Reference (SQL Server Compact)

SQL Reference (SQL Server Compact)