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

Understanding the Simple sample project Next Page

Using the Table Viewer code sample


This tutorial is based on the Table Viewer project that is included with the SQL Anywhere .NET Data Provider.

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

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

The Table Viewer project is more complex than the Simple project. It illustrates the following features:

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

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

  2. Choose File > Open > Project.

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

  4. If you want to 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 Table Viewer 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 Table Viewer code sample. To view the using directive:

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

    The Table Viewer dialog appears.

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

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


Understanding the Table Viewer sample project