Previous Topic Next topic Print topic


Tutorial: Catalog a Connection

Before you can connect to the SQL Server database you created earlier, you must catalog it using the ADO.NET Connection Editor.

Requirements
Before attempting this tutorial, you must complete the following tutorials in the order listed:
  • Tutorial: Create a SQL Server Database
  • Tutorial: Create and Configure a Visual Studio Project
  • Tutorial: Set OpenESQL Assistant Configuration Options
Phase 1: Start the OpenESQL Assistant
You can start the OpenESQL Assistant from the Start menu or from within Visual Studio. In this tutorial, we opt to start the OpenESQL Assistant from within Visual Studio.
  • From the Visual Studio IDE, click Tools > Micro Focus COBOL Tools > OpenESQL Assistant.
Phase 2: Start the ADO.NET Connection Editor
You can start the ADO.NET Connection Editor from the Start menu, or from within the OpenESQL Assistant. Here, we start it from within the OpenESQL Assistant.
  • From the OpenESQL Assistant, click ADO.NET Connection Editor ButtonADO.NET Connection Editor.
Phase 3: Catalog the OESQLDemo Connection
In this phase, we catalog a 32-bit connection to our SQL Server database.
Important: If you are running on a 64-bit machine, you must catalog a 64-bit connection in addition to the 32-bit connection. Both connections have the same data source name. To do this, complete all of the steps in this phase, and then repeat the steps of this phase with the following change:
  • Before performing step 1, on the Connection tab, click 64 bit.
  1. On the Connection tab, click Add.
    Note: The 32-bit connection cataloged here does not require that we change any of the default settings on the Connection tab of the ADO.NET Connection Editor.
  2. In the grid on the Provider tab, click SqlClient Data Provider.
  3. In the Data Source Name field, type OESQLDemo, which is the name of your connection; then click Next, which takes you back to the Connection tab.
  4. With OESQLDemo selected on the Data Source Name list, modify the following fields on the Connection Settings grid, providing the appropriate values:
    Field Value
    Initial Catalog OESQLDemo
    Data Source (local)
    Integrated Security True
  5. Click Save to save your changes.
  6. Click Test Connection to ensure the connection works properly; then click OK to clear the message.
Phase 4: Close the ADO.NET Connection Editor
  • Click OK to close the ADO.NET Connection Editor.

    The OESQLDemo connection now appears on the list in the OpenESQL Assistant.

Phase 5: Refresh the Database Connection
For Visual Studio to recognize the connection you have cataloged, you must refresh it in the Server Explorer.
  1. From the Visual Studio IDE, open the Server Explorer.
  2. Right-click the connection listed for OESQLDemo, and select Refresh.

This completes the tutorial. Next, please complete Tutorial: Build and Test a Query.

Previous Topic Next topic Print topic