Takes you through the steps required to set up the SqlBookWCF Visual Studio solution used in this tutorial.
Create the SqlBookWCF solution and project
- In Visual Studio, click
.
- In the
New Project dialog box, expand
.
- Click the
Windows Desktop category.
- In the center pane, select
WCF Service Library.
- 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.
|
- Uncheck
Create directory for solution.
- 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.
- In the
Solution Explorer, right-click the solution; then select
Add > Existing Project.
- Browse to the
%PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\SqlBookWrapper directory.
- Double-click the
SqlBookWrapper COBOL project.
- Again, in the
Solution Explorer, right-click the solution; then select
Add > Existing Project.
- Browse to the
%PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\SqlLegacyBook directory.
- 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.
- In the
Solution Explorer, right-click the
SqlBookWCF project; then select
Add > Reference.
- In the left pane, expand
Solution; then click
Project.
- 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:
- In the
Solution Explorer, delete the
app.config,
IService1.cbl, and
Service1.cbl files from the
SqlBookWCF project.
- Right-click the project; then select
Add > Existing Item.
- On the
Add Existing Item dialog box, select
All Files (*.*) from the
Filename filter drop-down list.
- Browse to the
%PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\SqlBookDemoWCF\SqlBookWCF directory.
- Select the following files:
- app.config
- ISqlBook.cbl
- SqlBookService.cbl
- Click
Add.
Build the solution
- In the
Solution Explorer, right-click the
SqlBookWCF solution; then select
Build Solution from the context menu.