Question: In this lab assignment, you will do the following: Create a SQL Server Express Database with two tables Add records to Tables in a database

In this lab assignment, you will do the following:

Create a SQL Server Express Database with two tables

Add records to Tables in a database

Use GridView Data Controls to display table records

Validate user input before querying a database

Use SqlDataSource design wizard to join two tables

Create a SQL Server Express Database with two tables

Start up Server Explorer to create a new database file Lab3.mdf

Add two tables to your database: Suppliers and Inventory

Add the columns to Suppliers and Inventory

Let SupplierId be the primary key of type int for the Suppliers table and set its Identity Specification (Is Identity) to Yes (increment by 1)

Let InventoryId be the primary key of type int for the Inventory table and set its Identity Specification (Is Identity) to Yes (increment by 1)

Add records to Tables in a database

Add the records to the Suppliers table for three suppliers and to the Inventory table for five items in inventory:

Use GridView Data Controls to display table records

Add the HTML, GridView, and SqlDataSource controls to your Default.aspx page to

Display all the suppliers

Display the entire inventory

Allow the user to enter a quantity, click the "Get Reorder List" button, and display all items at or below the quantity entered

Validate user input before querying a database

Add validation controls to the "Get Reorder List" button to guard against the user entering illegal quantities.

Edit the GridView's EmptyDataTemplate so that if there are no items that need to be re-ordered (based on quantity), your GridView should display No items need to be re-ordered.

Use SqlDataSource design wizard to join two tables

Add an improved reorder list GridView to your Default.aspx page that displays just the product name, supplier name, and quantity for items that need to be re-ordered.

Note: The SqlDataSource design wizard's Query Builder can be used to help write SQL statements that perform a join on multiple tables in a database.

Add a new SqlDataSource control to your Default.asp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!