Loading the Sales Scheduling Database

 < Day Day Up > 

To run the code accompanying this chapter, you will need to create a database in Microsoft SQL Server named SalesScheduling. The book's Web site contains a database file named SalesScheduling.mdf that can be attached to a SQL Server installation.

To attach the SQL database, execute the following steps:


Copy the SalesScheduling.mdf and SalesScheduling.ldf files from the book's Web site to a local directory on the server where Microsoft SQL Server is installed.


Open Microsoft Enterprise Manager


Right-click the Databases node and click All Tasks. . . and Attach Database. . .


From the Attach Database dialog (see Figure 3.1), browse to the directory where you copied the database files in step 1 and select the SalesScheduling.mdf file. Click OK.

Figure 3.1. Screenshot of the Attach Database dialog inside Microsoft Enterprise Manager. This dialog is used to attach the SalesScheduling database to your local SQL Server.


Click OK to attach the database.


To see the newly added database, you will need to click Action and Refresh.

The database is simple and consists of nine tables, but two of them (Statuses and ZipRegions) are for reference purposes only. Figure 3.2 shows a diagram of the database to illustrate the relationship between tables.

Figure 3.2. SQL Server 2000 database used by Slugger Sports. The database is named SalesScheduling. The primary table that drives the sample telephony application is ScheduledItems.

Marketing and sales people at the home office utilize an in-house application to add contact opportunities to the Leads table. When a new lead is entered, it is assigned the status value of 'N' to indicate it is new. As the regional salespeople build their schedules, new items are added to the ScheduledItems table. As leads are reviewed, the value of status is changed to either 'S' for scheduled or 'B' for bypassed.

Leads become customers only after an order has been placed. For every customer, there is a corresponding lead record, but not all leads become customers. The ZipRegions table is used to group postal codes within a 100-mile radius. This helps regional salespeople identify which leads are in their area. The Statuses table contains all the possible stages that an order can be in.

To ensure consistent data access, the application will utilize the Microsoft Data Access Application Block, version 2. Available as a free download from the Microsoft Patterns and Practices Web site at http://www.microsoft.com/resources/practices/code.mspx, the Data Access Block is one of several projects Microsoft offers. Each project contains efficient and well-proven methods for accomplishing common tasks. The application also utilizes the Exception Management Application block to log encountered exceptions to the Web server's event log.

     < Day Day Up > 

    Building Intelligent  .NET Applications(c) Agents, Data Mining, Rule-Based Systems, and Speech Processing
    Building Intelligent .NET Applications(c) Agents, Data Mining, Rule-Based Systems, and Speech Processing
    ISBN: N/A
    EAN: N/A
    Year: 2005
    Pages: 123

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net