Working with Transactions with an SQL Server Database

Transactions provide a way for you to group together database executions as a group so that they succeed or fail together. For example, if you had an e-commerce site you may have code that allows visitors to add a quantity of an item to their shopping cart. When you do that you also want to remove the number of items ordered from your inventory.Therefore, you have two actions that you need to execute. You want to add items to a shopping cart and you want to remove items from inventory.These executions need to happen as a group. You don’t want to add items to the shopping cart if something goes wrong with removing them from inventory. And the opposite is also true.Therefore, the database executions need to be grouped in a Transaction. This technique shows youhow to use a Transaction object with an SQL Server database.This ASP.NET page contains SQL Delete statements that delete records from the Employees table. But the records are not deleted because they are in a transaction and the transaction is not committed to the database.

Sub Category and Product Detail Pages

Because customers can’t pick up virtual merchandise and read labels, the product detail page represents the product or behaves like the product package. It must clearly communicate what the product is and what the customer will receive as a result of its purchase. Anytime a page offers a product for sale, it must provide the following information for each of the products offered:

  • What it is—the description, picture, uses
  • Relevant and complete compatibility, sizing, color, or other information
  • What’s contained in the package—what the customer will receive
  • Other items needed for immediate operation (batteries, cables, assembly, UL specifications)
  • Spare or complementary items (extra batteries, film, or a carrying case)
  • "Care and feeding" of the product (special polish, cleaning instructions)
  • The price and any hidden charges (extra shipping or handling)
  • The manufacturer’s or designer’s name
  • Sample content (for example, sample book pages)

The customer must know clearly what the product is and what it looks like. And for customers who know exactly what they are looking for, accurate descriptions and specific product numbers or models must be included so they may easily recognize the correct product. Our research across more than 25 major elcommerce websites identified incomplete or inadequate information. In many cases, the web stores did not provide complete compatibility information.

Shoppers will not purchase from a site that cannot confirm their choice or be specific about what the product is that they are purchasing.

Product detail pages let customers know what they’re getting and what else they may need or want. In this example, product features—the "speeds and feeds"—are listed. This includes products they may need to purchase in order to use the product. It also features other products the customer may want. Good clothing stores recommend coordinated accessories to give customers ideas to complete ensembles for a variety of social occasions.