Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

visual studio Asp.net PROJECT DOWNLOAD LINK https://filebin.net/ee3j6oozam45yd6y Enhance the Product List application In this exercise, youll add a calculated column to the Product List application

visual studio Asp.net

PROJECT DOWNLOAD LINK

https://filebin.net/ee3j6oozam45yd6y

Enhance the Product List application

In this exercise, youll add a calculated column to the Product List application that was presented in the book so it looks like this:

Utilizing SQL Statement to Configure Data Source

image text in transcribed

Update the data source

  1. Open the XEx13ProductList application from your blackboard directory. This is the Product List application that was presented in chapter 13 of the book.
  2. Select the Configure Data Source command from the smart tag menu of the SQL data source for the data list control to start the Configure Data Source wizard.
  3. Click the Next button when the first dialog box is displayed to use the current connection, and click the Next button again in the second dialog box to enter a custom SQL statement.
  4. The Select tab in the next dialog box will contain the current Select statement. Now, click the Query Builder button to display the Query Builder.
  5. Use the grid pane to add a calculated column that multiplies the UnitPrice column by the OnHand column, and assign an alias of Total to this column. Then, accept this change to return to the Configure Data Source dialog box.
  6. Click the Next button, and then click the Next button again in the dialog box that lets you define parameters.
  7. Test the query in the last Configure Data Source dialog box, and then click the Finish button.
  8. When youre asked if you want to regenerate the DataList ItemTemplate and DataKeyField, click No. Notice that the data list hasnt changed, but the data source has.

Update the data list to show the calculated value

  1. Display the data list in Source View. Then, in the HeaderTemplate, add a span tag for the new Total column, using the existing span tags as a guide. Adjust the Bootstrap column classes so the total for all the span tags doesnt exceed 12.
  2. In the ItemTemplate, add a label for the new Total column, and assign the ID lblTotal to it. Then, bind it to the Total field of the data source and apply the currency format. You can use the label for the UnitPrice column as a guide. Finally, adjust the Bootstrap column classes to match the column classes in the HeaderTemplate.
  3. Run the application to be sure it looks as shown above.
http://localhost65166/Default.aspx Ch13: Product List lalloween Superstore For thetti lin in all of us Choose a category Costumes ID frankc01 hippie01 jar01 martiano1 pow01 super01 Product Frankenstein Hippie JarJar Martian Austin Powers Supermarn Unit Price $39.99 $79.99 $59.99 $69.99 $79.99 $39.99 On Hand 100 40 25 100 25 100 Total $3,999.00 $3,199.60 $1,499.75 $6,999.00 $1,999.7:5 $3,999.00 http://localhost65166/Default.aspx Ch13: Product List lalloween Superstore For thetti lin in all of us Choose a category Costumes ID frankc01 hippie01 jar01 martiano1 pow01 super01 Product Frankenstein Hippie JarJar Martian Austin Powers Supermarn Unit Price $39.99 $79.99 $59.99 $69.99 $79.99 $39.99 On Hand 100 40 25 100 25 100 Total $3,999.00 $3,199.60 $1,499.75 $6,999.00 $1,999.7:5 $3,999.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions