Visual COBOL ASP.NET Shopping Cart Demonstration
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 MFShopCartVC.zip files that are attached to this article.
Unzip MFShopCartVC.zip 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.