Using Programming Interfaces
The APIs available for use with Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) when you use Microsoft Visual Studio 2005 as the development environment are:
- .NET Compact Framework data providers
- System.Data.SqlServerCe namespace (for use with SQL Server Compact Edition)
- System.Data.Sqlclient namespace (for use with SQL Server)
- OLE DB provider for SQL Server Compact Edition (uses Microsoft eMbedded Visual C++ [eVC++] language)
To work with a database, an API does the following:
- Opens a connection to the database.
- 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.
- 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.
- 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.
- Disconnects when finished working in the database.
The programmer must understand both SQL statements and the appropriate use of the database API.
See Also
Other Resources
Programming Reference (SQL Server Compact Edition)
SQL Server Compact Edition .NET Programming
SQL Server Compact Edition Native Programming
SQL Reference (SQL Server Compact Edition)