Microsoft Visual C
Data sources exercise
Average difficulty

This Microsoft Visual C# DATA SOURCES exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl VISUAL C# 2005 WINDOWS FORMS course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Creating SQL Server Express tables

1) Create a new database within your project called Mortgage.
2) Double-click on this to go into Server Explorer.
3) Create a new table to hold the types of mortgage.  There are two fields in this table:
  • The MortgageTypeId (the primary key), which numbers the records
  • The MortgageTypename, which gives the name of each type of mortgage
4) Enter records within this table as follows:
  • Endowment
  • Repayment
  • Pension
  • ISA
  • Never
5) Create a new view listing the mortgage types alphabetically by name, and save this as VwMortgageType:
Exercise screen-shot 1257 Your view should look like this - notice that this view is not sorted!
6) Create a table called Person, with the following fields:
  • PersonId (the unique primary key)
  • PersonName (the name of the person)
  • LoanAmount (a decimal field holding the amount of money required)
  • MortgageTypeId (this will hold the type of mortgage)
7) Enter a few people into your table, with likely mortgages.
8) Create a view listing your people by name, and save this as VwPerson.
9) Optionally, create a database diagram, and use this to link your two tables together.
10) Close any open windows.

Thank you for showing an interest in this Visual C# 2005 Windows Forms training course!

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