Running Simple Code Sample in Visual Studio .NET

Review the instructions to run simple code sample in Microsoft Visual Studio .NET.

  1. Start Visual Studio .NET.
  2. Choose File > Open > Project.
  3. Browse to the sample project:

    For C#, browse to <install dir>\Samples\CSharp\Simple and open Simple.csproj.

    For Visual Basic .NET, browse to <install dir>\Samples\VB.NET\Simple and open Simple.vbproj.

  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 the 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 Adaptive Server ADO.NET Data Provider Assembly.
  7. To run the Simple sample, choose Debug > Start Without Debugging, or press Ctrl+F5.

    The AseSample dialog box appears.

  8. In the AseSample dialog box, provide connection information for an Adaptive Server with the sample pubs2 database and then click Connect.

    The application connects to the sample pubs2 database and puts the last name of each author in the dialog box.

  9. Click X in the upper right corner of the window to terminate the application and disconnect from the pubs2 database.

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

Related tasks
Adding a Reference to Adaptive Server ADO.NET Data Provider in a Visual Studio .NET Project