Running Table Viewer Code Sample in Visual Studio .NET

Run the Table Viewer code sample project in Microsoft Visual Studio .NET.

  1. Start Visual Studio .NET.
  2. Choose File > Open > Project.
  3. Browse to the Samples directory in your Adaptive Server ADO.NET Data Provider installation directory. Go to the CSharp or VB.NET directory and open the Table viewer project.
  4. If you have installed Adaptive Server ADO.NET Data Provider using the installation program, go directly to step 7.
  5. If you have not used the installation program, then you need to correct references to Adaptive Server ADO.NET Data Provider in the project. To do this, delete the existing reference first:
    1. In the Solution Explorer window, verify that the Simple project is expanded.
    2. Expand the References folder.
    3. Right-click Sybase.Data.AseClient and select Remove.
  6. Add a reference to the Adaptive Server ADO.NET Data Provider Assembly.
  7. To run the TableViewer sample, choose Debug > Start Without Debugging or press Ctrl+F5.
  8. In the Table Viewer dialog box, supply connection information to an Adaptive Server with pubs2 sample database installed. Click Connect.

    The application connects to the Adaptive Server pubs2 sample database.

  9. In the Table Viewer dialog box, click Execute.

    The application retrieves the data from the authors table in the sample database and puts the query results in the Results DataList.

    You can also execute other SQL statements from this application. Enter a SQL statement in the SQL Statement pane and click Execute.

  10. Click the X in the upper right corner of the window to terminate the application and disconnect from the sample database.
Related tasks
Adding a Reference to Adaptive Server ADO.NET Data Provider in a Visual Studio .NET Project