Example Step 5: Update the Database

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

This topic describes how to update the database to store instances of the extended class.

To update the database

  1. Add a new column to the LineItems table in the transactions database for your application. For this example, add a new property named WidgetDescriptionProperty, set its data type to nvarchar(64), and allow null values.

  2. Because you deployed the assembly that contains the extended orders class locally instead of in the Global Assembly Cache (GAC), you must run the Order Mapping tool from the same directory that contains the configuration files. Create a new directory and copy the following files into the new directory:

    • Copy the OrderMapping.exe file from the %COMMERCE_SERVER_ROOT%/Tools directory.

    • Copy the Web.config file from the virtual root of the Web site.

    • Copy the OrderObjectMappings.xml file from the virtual root of the Web site.

    • Copy the MyOrders.dll assembly from the \bin directory of the virtual root of the Web site.

  3. Open a Command Prompt window, change to the directory that you created in step 2, and type the following command:

    OrderMapping.exe /w Web.config

    The order mapping tool creates a file that is named OrdersStorage.sql.

  4. If you are using SQL Server 2005, open the OrdersStorage.sql file from the SQL Management Studio and execute the query against the transactions database. If you are using SQL Server 2000, use SQL Query Analyzer to load and execute the OrdersStorage.sql file against the transactions database.

See Also

Other Resources

How to Generate SQL Tables and Stored Procedures for Orders Mapped Storage

Orders Example: Extending the LineItem Class