Set Up the SqlBookDemoWebApplication Solution

Takes you through the steps required to set up the SqlBookDemoWebApplication Visual Studio solution used in this tutorial.

Create the SqlBookDemoWebApplication solution and project

In this procedure, you create the SqlBookDemoWebApplication solution and project, which contains skeleton versions of the files listed in the Demonstration Solution section.

  1. In Visual Studio, click File > New > Project.
  2. In the New Project dialog box, expand Installed > COBOL.
  3. Click the Web category.
  4. In the center pane, select ASP.NET Web Application.
  5. Complete the fields as follows:
    Name SqlBookDemoWebApplication
    Location c:\tutorials\SQL
    Solution Name SqlBookDemoWebApplication
    Framework Choose the appropriate .NET Framework version from the drop-down list.
    Note: Must be version 4.5 or later.
  6. Uncheck Create directory for solution.
  7. Click OK.

Add existing projects

We provide the SqlBookWrapper and SqlLegacyBook projects for you to add to the solution. These contain application source code and references.

  1. In the Solution Explorer, right-click the solution; then select Add > Existing Project.
  2. Browse to the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\SQL\\SqlBookWrapper directory.
  3. Double-click the SqlBookWrapper COBOL project.
  4. Again, in the Solution Explorer, right-click the solution; then select Add > Existing Project.
  5. Browse to the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\SQL\\SqlLegacyBook directory.
  6. Double-click the SqlLegacyBook COBOL project.

Add project references

The two projects you just added to the solution need to be incorporated by reference. Here you create a reference from the SqlBookDemoWebApplication project to the SqlBookWrapper and SqlLegacyBook projects.

  1. In the Solution Explorer, right-click the SqlBookDemoWebApplication project; then select Add > Reference.
  2. In the left pane, expand Projects; then click Solution.
  3. In the right pane, check SqlBookWrapper and SqlLegacyBook; then click OK.

Declare a Data Item

  1. In the Solution Explorer, open the Default.aspx.cbl file, located in the SqlBookDemoWebApplication project under the Default.aspx entry.
  2. Declare the my-book data item in the working-storage section as follows:
           01 my-book   type SqlBookWrapper.SqlBook.
  3. Save and close the file.

Build the SqlBookDemoWebApplication Solution

  • In the Solution Explorer, right-click the SqlBookDemoWebApplication solution; then select Build Solution from the context menu.