Set Up the SqlBookWCF Solution

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

Create the SqlBookWCF solution and project

  1. In Visual Studio, click File > New > Project.
  2. In the New Project dialog box, expand Installed > COBOL.
  3. Click the Windows Desktop category.
  4. In the center pane, select WCF Service Library.
  5. Complete the fields as follows:
    Name SqlBookWCF
    Location c:\tutorials\SQL
    Solution Name SqlBookWCF
    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\Visual COBOL\Samples\SQL\ado.net\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\Visual COBOL\Samples\SQL\ado.net\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 SqlBookWCF project to the SqlBookWrapper and SqlLegacyBook projects.

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

Replace generated components

When you created the SqlBookWCF project, it generated some default configuration and source code files. We have provided updated files to replace these:

  1. In the Solution Explorer, delete the app.config, IService1.cbl, and Service1.cbl files from the SqlBookWCF project.
  2. Right-click the project; then select Add > Existing Item.
  3. On the Add Existing Item dialog box, select All Files (*.*) from the Filename filter drop-down list.
  4. Browse to the %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\SqlBookDemoWCF\SqlBookWCF directory.
  5. Select the following files:
    • app.config
    • ISqlBook.cbl
    • SqlBookService.cbl
  6. Click Add.

Build the solution

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