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.
- 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.
- 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.
- In the grid on the
Provider tab, click
SqlClient Data Provider.
- 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.
- 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
|
- Click
Save to save your changes.
- Click
Test Connection to ensure the connection works properly; then click
OK to clear the message.
- Phase 4: Close the ADO.NET Connection Editor
-
- Phase 5: Refresh the Database Connection
- For Visual Studio to recognize the connection you have cataloged, you must refresh it in the Server Explorer.
- From the Visual Studio IDE, open the Server Explorer.
- Right-click the connection listed for OESQLDemo, and select
Refresh.
This completes the tutorial. Next, please complete
Tutorial: Build and Test a Query.