Microsoft ASP.NET
Using Databases exercise
Average difficulty

This Microsoft ASP.NET USING DATABASES exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ASP.NET 2.0 USING C# course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Choosing Harry Potter person by status

A full answer to this exercise is provided as part of the training course!

1) Create a new database using SQL Server Express (or Access, if you prefer). 
2) Create a table called tblStatus, with fields StatusId and StatusName.   Enter the following statuses/stati:
  • Goodies (this will be id number 1)
  • Baddies (this will be id number 2)
  • Not sure yet (this will be id number 3)
3) Create another table called tblPerson, with fields PersonId, PersonName and StatusId.  Enter the following people in this table:
  • Harry Potter (StatusId 1)
  • Ron Weasley (StatusId 1)
  • Professor Snape (StatusId 3)
  • Draco Malfoy (StatusId 2)
  • Albus Dumbledore (StatusId 1)
  • Barty Crouch (StatusId 3)
4) Create a simple form with an OK button to allow a user to choose a status:
Exercise screen-shot 1620 Use the AppendDataBoundItems property to append database items to your dropdownlist
5) Add another form field containing another dropdownlist so that your user can choose people for the status you have chosen:
Exercise screen-shot 1621 The second dropdownlist uses a WHERE clause to display those people whose status id equals that chosen in the first dropdownlist
6) Save and close down any files that you have open.

Thank you for showing an interest in this ASP.NET 2.0 using C# training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content copyright Wise Owl Business Solutions Ltd.  All rights reserved.  Design by Branches.