Understanding the Simple sample project

This section illustrates some key features of the SQL Anywhere .NET Data Provider by walking through some of the code from the Simple code sample. The Simple code sample uses the SQL Anywhere sample database, demo.db, which is held in your SQL Anywhere samples directory.

For information about the location of the SQL Anywhere samples directory, see Samples directory.

For information about the sample database, including the tables in the database and the relationships between them, see SQL Anywhere sample database.

In this section, the code is described a few lines at a time. Not all code from the sample is included here. To see all the code, open the sample project in %SQLANYSAMP12%\SQLAnywhere\ADO.NET\SimpleWin32.

 Declaring controls
 Connecting to the database
 Defining a query
 Displaying the results
 Finishing off
 Error handling