Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » Tutorial: Using the SQL Anywhere .NET Data Provider

Introduction to the .NET data provider tutorial Next Page

Using the Simple code sample


This tutorial is based on the Simple project that is included with SQL Anywhere 10.

The complete application can be found in your SQL Anywhere samples directory at samples-dir\SQLAnywhere\ADO.NET\SimpleWin32.

For information about the default location of samples-dir, see Samples directory.

The Simple project illustrates the following features:

For more information about how the sample works, see Understanding the Simple sample project.

To run the Simple code sample in Visual Studio .NET
  1. Start Visual Studio .NET.

  2. Choose File > Open > Project.

  3. Browse to samples-dir\SQLAnywhere\ADO.NET\SimpleWin32 and open the Simple.sln project.

  4. When you use the SQL Anywhere .NET Data Provider in a project, you must add a reference to the Data Provider DLL. This has already been done in the Simple code sample. You can view the reference to the Data Provider DLL in the following location:

  5. You must also add a using directive to your source code to reference the Data Provider classes. This has already been done in the Simple code sample. To view the using directive:

  6. Choose Debug > Start Without Debugging or press Ctrl+F5 to run the Simple sample.

    The SQL Anywhere Sample dialog appears.

  7. Click the X in the upper right corner of the screen to terminate the application and disconnect from the sample database. This also shuts down the database server.

You have now run the application. The next section describes the application code.


Understanding the Simple sample project