Lesson 15:
Working With Data: Advanced Topics

Introduction

This week in Chapter 15: Working With Data - Advanced Topics you will learn how to style various data controls using the data in a newly created PlanetWrox database (do NOT use the sample database for this assignment).

By now you should have most of the work already done. In this week's assignment, after making a couple of tweaks to your Web site locally, you will be publishing all necessary files to the Student Web server in order to view your Management and Review pages remotely using the SQL server running on the Student Web server. This week's assignment consists of only one Try It Out and a modification to your All.aspx Web form in your Reviews folder followed by publishing and testing your results on the IA.MSJC.EDU Web server.

Assignment

This week you will get an opportunity to test out your Management and Review pages using the IA.MSJC.EDU SQL server and your PlantWrox database:

  • Read all of Chapter 15: Working with Data — Advanced Topics in your text book.
  • Complete all of the steps in the first Try It Out in Chapter 15 on pages 543 - 545.
  • Add a SQLDataSource control and a GridView control to your All.aspx Web form and then apply Auto Formatting to it using the instructions below.
  • Publish the following files to the IA.MSJC.EDU Web server:
    • Web.config file off the root of your Web site.
    • Management.master page from the MasterPages folder off the root of your Web site.
    • Management folder off the root of your Web site.
    • Reviews folder of the root of your Web site.

Instructions

Use the following step-by-step instructions for completing this week's assignment. Remember to use C# when copying code snippets from your text book and adding new items to your site which use code-behind files.

Step 1 Complete all of the steps in the Try It Out on pages 543 - 545.

Step 2 Open the All.aspx Web form in the Reviews folder off the root of your site.

Step 3 Add a SQLDataSource control to the All.aspx Web form. Open the SQLDataSource control's Smart Tasks panel and choose Configure Data Source . . . , select PlanetWroxConnectinString1 as your Data Connection and click Next.

Step 4 Configure the screen so it looks like figure 15-1:

 Configure Select Statement dialog box.
Figure 15-1: The Configure Data Source dialog's Configure the Select Statement screen showing the correct SELECT statement for the SQLDataSource control.

Step 5 Click Next, then click Finish.

Step 6 Add a Gridview control to the All.aspx Web form using the new SQLDataSource control as its Data Source. The apply an Auto Format of your choice to the Gridview control.

Step 7 Validate that your pages are working locally.

Step 8 If you have not already done so, modify the statement for PlanetWroxConnectionString1 in your your Web.config file to the following:

<add name="PlanetWroxConnectionString1" connectionString="Data Source=IA.MSJC.EDU; Initial Catalog=FirstName+LastName; Persist Security Info=True; User ID=FirstName+LastName; Password=FirstIntial+LastIntitial+7-digit Student ID+!" providerName="System.Data.SqlClient"/>

Then save your Web.config file.

Step 9 Publish the following files and folders to the Student Web server:

  • Web.config file off the root of your Web site.
  • Management.master page from the MasterPages folder off the root of your Web site.
  • Management folder off the root of your Web site.
  • Reviews folder of the root of your Web site.

Step 10 Validate that the pages in your Management and Reviews folders are working on the Student Web server.

Step 11 Post the URL for your Management folder to Canvas for scoring by the due date listed in the Syllabus. Example: http://IA.MSJC.EDU/7-digit student ID number/Management

Instructor's Note: Everything MUST be completed before the due date listed in the syllabus for this assignment.

Please email me if you have any questions at all!

⇑Table of Contents

Lesson Summary

In this lesson you learned how to:

  • Change the formatting of the various data-bound controls using styles, themes, and skins
  • Handle the various events that are fire by the data controls to change their appearance conditionally
  • Hand-code the UI of data access pages to get complete freedom over the pages' structure and markup
  • Use the built-in caching mechanisms to improve the performance of your website

Congratulations, that's it for this assignment. You have now completed this course.

⇑Table of Contents