Tutorial: Create and Configure a Visual Studio Project

In this tutorial, you create a Visual Studio Managed COBOL project to use as you complete the remainder of these tutorials.

Requirements
Before attempting this tutorial, you must complete Tutorial: Create a SQL Server Database.
Launch Visual COBOL for Visual Studio 2017
This procedure varies depending on your Windows version. If you need instructions, see To start Visual COBOL.
Create a New Managed COBOL Project
In this set of tutorials, you create a Managed COBOL application to take advantage of the features available in the ADO.NET connection editor, and the OpenESQL Managed Runtime.
  1. Start Visual COBOL. If you need instructions, see To start Visual COBOL.
  2. In Visual Studio, click File > New > Project.
  3. In the New Project dialog box, expand Installed > COBOL.
  4. Select Managed.
  5. In the center pane, select Console Application.
  6. In the Name field, type OESQLAssistantTutorial.
  7. In the Location field, specify a directory in which to store the project; then click OK.

    Visual Studio creates a new solution and a project named OESQLAssistantTutorial. The project contains one generic program, Program1.cbl, that you use in a later tutorial. If Visual Studio has automatically opened this file for editing, close it for now.

Set Project Properties
To compile this application such that it connects to the database via ADO.NET, you must set the project properties to include the DBMAN=ADO SQL compiler directive option. We must also set the BEHAVIOR compiler directive to provide optimal cursor behavior, including isolation level and lock concurrency settings.
  1. From the Solution Explorer, double-click Properties under your OESQLAssistantTutorial project.
  2. On the SQL tab, select OpenESQL from the ESQL Preprocessor drop-down list.
  3. Click Add.
  4. On the Available Directives list, click DBMAN; then click OK.
  5. Repeat steps 3 and 4, but this time add the BEHAVIOR directive.
  6. Back on the SQL tab, select BEHAVIOR on the Directives list.
  7. From the Value drop-down list, select ANSI.
  8. Click Save (Save); then close the Properties window.