Site Search

CS 351: Lab 3

Create the Database

Lab3 Database

  1. Start up Visual Studio 2005 and create a new ASP.NET Web Site named U:\Labs\nnLab3 where nn is your cs351 account number.
  2. Use Server Explorer to add the new database file Lab3.mdf on your desktop
  3. Write the stored procedure to create two tables in this database: Suppliers and Inventory with the columns (fields) shown on the right.
  4. Define the foreign key Inventory.SupplierId that references Suppliers.SupplierId

Fill the Database

Write the stored procedure to fill the Suppliers table with three suppliers and the Inventory table five items

Inventory Table

Suppliers Table

Typed Data Set

Create a typed DataSet to implement the DAL (Data Access Layer) for your project

Add three new TableAdapters to your project

  1. Suppliers
  2. Inventory
  3. Inventory_Supplier
    • Select ProductName, SupplierName, and Quantity WHERE Quantity <= @Quantity

DAL.xsd snapshot

Data Controls

Screen Snapshot

Add the HTML, ASP.NET controls, and three asp:GridView controls to your Default.aspx page to

Note: Do this with C# code and your custom adapters. The asp:GridViews should be minimal

<h3>All Suppliers</h3>
<asp:GridView ID="SuppliersGridView" runat="server" />

<h3>Entire Inventory</h3>
<asp:GridView ID="InventoryGridView" runat="server" />



Early Finishers

To Receive Credit

Lab 3 is an in-class assignment begun on Wednesday and due by the start of class on Friday