Visual COBOL ASP.NET Shopping Cart Demonstration

Visual COBOL ASP.NET Shopping Cart Demonstration

Attachment: MFShopCartVCReadme.pdf 


The original application that was used as the model for this demonstration was the ASP.NET Commerce Starter Kit (CSVS) demo from Microsoft. The original version was written in C# and has been rewritten here using the Visual COBOL language. Some of the original Web Forms, images and SQL Server Stored Procedures have been retained or modified for use within this version of the application.

This demo provides an inside look at how a relatively simple Internet shopping cart web site can be developed using the features available within the Visual COBOL product. The demo consists of an ASP.NET web application named MFShopCartVC which is a functioning real-world web site.

With Visual COBOL and Visual Studio 2010 you can develop and test your Web Applications under an internal File System Web Server which allows your web application to reside in any directory on your hard disk, without any IIS intervention. This demo uses the File System Web Server so that it can be run with a minimal amount of setup.

The demo application requires that a version of Microsoft SQL Server 2005, SQL Server 2008 or SQLEXPRESS 2008 be installed on the local computer where the application will be run. If you do not have a version of SQL Server installed then SQLEXPRESS can be installed as part of the Visual Studio 2010 product at no charge.

The application was developed with Visual COBOL 2010 R3 using the ASP.NET Application support. The application consists of a single ASP.NET COBOL project named MFShopCartVC which contains multiple ASP.NET Web Forms and COBOL class programs which are all compiled and generated within a single .NET Assembly file named MFShopCartVC.dll.

ASP.NET Web Forms have a file extension of “.aspx” and are developed using the codebehind technology available within Visual Studio 2010 and ASP.NET. This means that although a Web Form’s “.aspx” file may look like a standard HTML file containing markup elements and script code, the actual logic behind the processing and event handling code of the web application resides in a compiled COBOL class program that inherits from the .NET Framework “System.Web.UI.Page” class.

In addition to the codebehind COBOL programs there are some additional “Helper” COBOL class programs that are called from within these codebehind programs in order to handle the interface between the Web Forms and the SQL Server database.

These database programs were written to show the various techniques that are available to a programmer when writing code to access a SQL Server database from within the .NET Framework.

For example, the Visual COBOL OpenESQL product was used to generate embedded EXEC SQL and ADO statements that can either be run directly within a program or by calling an external SQL Server stored procedure.

The EXEC ADO extensions to OpenESQL are also used to declare and open a database cursor and then store it into an ADO.NET DataSet or DataReader object that is returned to the invoking program. This ADO.NET object can then be automatically bound to Web Controls such as a DataGrid or DataList by invoking the Web Control’s “DataBind” method.


Please download the MFShopCartVCReadme.pdf and files that are attached to this article.

Unzip onto your hard drive retaining the folder structure within the zip file.

All instructions for building, running and debugging the demo can be found in the MFShopCartVCReadme.pdf file.

Happy Shopping!



Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.


when I compile the code, I get the following error:

C:\MFShopCartVC\App_Classes\ShoppingCartDB.cbl (287,19) : error COBCH0829 : Could not find method 'adoasetvdecimal' with this signature

This compiler error seems to be caused by a bug in the Visual COBOL R4 Update 2 version.

It is caused by a COMP-3 data item which is being mapped incorrectly.

The problem has been fixed in the Visual COBOL 2.0 release which is due to go GA next month.

Sorry about that!

Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2012-06-21 16:58
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.