Tutorial: Using the Advanced code sample

This tutorial is based on the Advanced project that is included with Adaptive Server ADO.NET Data Provider. The complete application can be found in your Adaptive Server ADO.NET Data Provider installation directory:

For C#:

<install dir>\Samples\CSharp\Advanced\Advanced.csproj

For Visual Basic .NET:

<install dir>\Samples\VB.NET\Advanced\Advanced.vbproj

The Advanced project illustrates the following features:

StepsRunning the Advanced code sample in 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 Advanced 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, 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.AseClient.Data.dll and select Remove.

  6. Add a reference to the Adaptive Server ADO.NET Data Provider Assembly.

  7. Choose Debug | Start Without Debugging to run the Advanced project.

    The Form1 dialog box appears.

  8. In the Form1 dialog box, click Connect.

    The application connects to the Adaptive Server sample database.

  9. In the Form1 dialog box, click Execute.

    The application executes the stored procedure and gets back an input-output parameter, output parameter, and a return value.

  10. Click the X in the upper right-hand corner of the window to terminate the application and disconnect from the sample database.

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

StepsRunning the Advanced sample project without Visual Studio

  1. Open a DOS prompt and go to the appropriate sample directory under the <install directory>\Samples directory.

  2. Add the directory with .NET Framework 1.1 binaries to your system path.

  3. Verify that the dll directory under the Adaptive Server ADO.NET Data Provider installation directory, is included in the system path and the LIB environment variable.

  4. Compile the sample program using the supplied build script build.bat.

  5. To run the program, enter:

    advanced.exe
    
  6. The Form1 dialog box appears. Click Connect.

    The application connects to the Adaptive Server sample database.

  7. In the Form1 dialog box, click Execute.

    The application executes the stored procedure and gets back an input-output parameter, output parameter, and a return value.

  8. Click the X in the upper right-hand corner of the window to terminate the application and disconnect from the sample database.

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