Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

6.3. Solution

Now that the design is complete, you should have a very clear idea about what is required, so now we can consider how we're going to implement this functionality. You'll follow the same order as the "Design" section, starting with the creation of database tables and stored procedures, the configuration, DAL and BLL classes, and finally the ASPX pages and the PollBox user control.

6.3.1. Working on the Database

The tables and stored procedures required for this module are added to the same sitewide SQL Server 2005 database (aspnetdb.mdf) shared by all modules, although the configuration settings enable you to have the data and the db objects separated into multiple databases if you prefer to do it that way. It's easy to create the required objects with Visual Studio 2005 using the integrated Server Explorer, which has been enhanced in the 2005 version so that it's almost like using SQL Server 2000's Enterprise Manager, but right from within the Visual Studio IDE. Figure 6-4 is a screenshot of the IDE when adding columns to the tbh_Polls tables, and setting the properties for the PollID primary key column.

Figure 6.4. Figure 6-4

After creating the two tables with the columns indicated in Figure 6-1, you need to create a relationship between them over the PollID column, and set up cascade updates and deletes (Select Data Add New Diagram to bring up the interactive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.